Bit shuffle processors, methods, systems, and instructions

ABSTRACT

A processor includes packed data registers and a decode unit to decode an instruction. The instruction is to indicate a first source operand having at least one lane of bits, and a second source packed data operand having a number of sub-lane sized bit selection elements. An execution unit is coupled with the packed data registers and the decode unit. The execution unit, in response to the instruction, stores a result operand in a destination storage location. The result operand includes, a different corresponding bit for each of the number of sub-lane sized bit selection elements. A value of each bit of the result operand corresponding to a sub-lane sized bit selection element is that of a bit of a corresponding lane of bits, of the at least one lane of bits of the first source operand, which is indicated by the corresponding sub-lane sized bit selection element.

CROSS REFERENCE TO RELATED APPLICATIONS

This present patent application is a continuation of U.S. patentapplication Ser. No. 15/508,284, filed on Mar. 2, 2017, entitled “BITSHUFFLE PROCESSORS, METHODS, SYSTEMS, AND INSTRUCTIONS” which is a U.S.National Phase Application under 35 U.S.C. Section 371 of InternationalApplication No. PCT/US2015/048627, filed on Sep. 4, 2015, entitled “BITSHUFFLE PROCESSORS, METHODS, SYSTEMS, AND INSTRUCTIONS” which claims thebenefit of EP Application No. 14382361.5, filed Sep. 25, 2014, which ishereby incorporated by reference

BACKGROUND Technical Field

Embodiments described herein generally relate to processors. Inparticular, embodiments described herein generally relate to bitmanipulation in processors.

Background Information

Processors execute various different types of instructions to operate ondata elements. For example, an add instruction may be used to add afirst 16-bit data element in a first register to a second 16-bit dataelement in a second register, and store a 16-bit result data element ina destination register. Each data element may represent a separateindividual piece of data, such as, for example, a pixel color code, aninteger value representing a number of items, etc.

In addition to operating on whole data elements (e.g., 8-bit, 16-bit,32-bit, or 64-bit data elements), it is sometimes also useful tomanipulate the individual bits within a single data element. However, ascompared operating on whole data elements, manipulating the individualbits within a single data element often tends to be relatively slowand/or inefficient in processors. As one example, an algorithm to obtainthe values of individual bits in a single data element may include, foreach individual bit, one instruction to rotate or shift all the bits ofthe data element (e.g., shift all 16-bits) to place the individual bitin a particular position, and another instruction to perform a bitwiselogical operation (e.g., a logical AND, a logical OR, etc.) with therotated/shifted bits and a mask data element configured to select theindividual bit, to isolate or accumulate the individual bit.

This is just one example, but regardless of the particular approach usedby the algorithm, generally one or more separate instructions may beneeded for each individual bit value obtained. As a result, the totalnumber of instructions needed generally tends to increase approximatelyproportionally with the total number of bit values to be obtained. Forexample, roughly twice as many instructions may be needed to obtain allthe bit values of a 32-bit data element as would be needed to obtain allthe bit values of a 16-bit data element. In addition, the algorithmmanipulates all the bits of the data element for each individual bitvalue obtained (e.g., shifts all the bits, performs a logical operationon all the bits, etc.), which also tends to make the performance of thealgorithm less than optimal.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention may best be understood by referring to the followingdescription and accompanying drawings that are used to illustrateembodiments. In the drawings:

FIG. 1 is a block diagram of an embodiment of a processor that isoperable to perform an embodiment of a bit shuffle instruction.

FIG. 2 is a block flow diagram of an embodiment of a method in aprocessor of performing an embodiment of a bit shuffle instruction.

FIG. 3 is a block diagram of an embodiment of a bit shuffle operation.

FIG. 4 is a block diagram of an embodiment of a bit shuffle operation toshuffle bits of 64-bit lanes of a first source packed data operand using8-bit byte sized bit selection elements in a second source packed dataoperand to generate a scalar result operand.

FIG. 5 is a block diagram of an embodiment of a bit shuffle operation toshuffle bits of 16-bit lanes of a first source packed data operand using4-bit nibble sized bit selection elements in a second source packed dataoperand to generate a scalar result operand.

FIG. 6 is a block diagram of an embodiment of a data element broadcastoperation that may optionally be combined with a bit shuffle operation.

FIG. 7 is a block diagram of an embodiment of a bit shuffle operation toshuffle bits of 64-bit lanes of a first source packed data operand using8-bit byte sized bit selection elements in a second source packed dataoperand to generate a result packed data operand.

FIG. 8 is a block diagram of an embodiment of a masked bit shuffleoperation to shuffle bits of a 64-bit lane of a first source packed dataoperand using 8-bit byte sized bit selection elements in a second sourcepacked data operand subject to mask elements in a source packed dataoperation mask operand to generate a result packed data operand.

FIG. 9 is a block diagram of an embodiment of bit shuffle instruction.

FIG. 10 is a block diagram of an embodiment of a suitable set of packeddata registers.

FIG. 11 is a block diagram of an embodiment of a suitable set of packeddata operation mask registers.

FIG. 12 is a block diagram of a packed data operation mask register andshows that the number of mask bits may depend on the packed data anddata elements sizes.

FIGS. 13A-C are block diagrams illustrating a generic vector friendlyinstruction format and instruction templates thereof, according toembodiments of the invention.

FIG. 14A-B is a block diagram illustrating an exemplary specific vectorfriendly instruction format and an opcode field, according toembodiments of the invention.

FIG. 15A-D is a block diagram illustrating an exemplary specific vectorfriendly instruction format and fields thereof, according to embodimentsof the invention.

FIG. 16 is a block diagram of an embodiment of a register architecture.

FIG. 17A is a block diagram illustrating an embodiment of an in-orderpipeline and an embodiment of a register renaming out-of-orderissue/execution pipeline.

FIG. 17B is a block diagram of an embodiment of processor core includinga front end unit coupled to an execution engine unit and both coupled toa memory unit.

FIG. 18A is a block diagram of an embodiment of a single processor core,along with its connection to the on-die interconnect network, and withits local subset of the Level 2 (L2) cache.

FIG. 18B is a block diagram of an embodiment of an expanded view of partof the processor core of FIG. 18A.

FIG. 19 is a block diagram of an embodiment of a processor that may havemore than one core, may have an integrated memory controller, and mayhave integrated graphics.

FIG. 20 is a block diagram of a first embodiment of a computerarchitecture.

FIG. 21 is a block diagram of a second embodiment of a computerarchitecture.

FIG. 22 is a block diagram of a third embodiment of a computerarchitecture.

FIG. 23 is a block diagram of a fourth embodiment of a computerarchitecture.

FIG. 24 is a block diagram of use of a software instruction converter toconvert binary instructions in a source instruction set to binaryinstructions in a target instruction set, according to embodiments ofthe invention.

DETAILED DESCRIPTION OF EMBODIMENTS

Disclosed herein are bit shuffle instructions, processors to execute theinstructions, methods performed by the processors when processing orexecuting the instructions, and systems incorporating one or moreprocessors to process or execute the instructions. In the followingdescription, numerous specific details are set forth (e.g., specificinstruction operations, data formats, processor configurations,microarchitectural details, sequences of operations, etc.). However,embodiments may be practiced without these specific details. In otherinstances, well-known circuits, structures and techniques have not beenshown in detail to avoid obscuring the understanding of the description.

FIG. 1 is a block diagram of an embodiment of a processor 100 that isoperable to perform an embodiment of a bit shuffle instruction 102. Insome embodiments, the processor may be a general-purpose processor(e.g., a general-purpose microprocessor or central processing unit (CPU)of the type used in desktop, laptop, or other computers). Alternatively,the processor may be a special-purpose processor. Examples of suitablespecial-purpose processors include, but are not limited to,cryptographic processors, communications processors, network processors,co-processors, graphics processors, embedded processors, digital signalprocessors (DSPs), and controllers (e.g., microcontrollers). Theprocessor may have any of various complex instruction set computing(CISC) architectures, reduced instruction set computing (RISC)architectures, very long instruction word (VLIW) architectures, hybridarchitectures, other types of architectures, or have a combination ofdifferent architectures (e.g., different cores may have differentarchitectures).

During operation, the processor 100 may receive the bit shuffleinstruction 102. For example, the instruction may be received frommemory over an interconnect. The bit shuffle instruction may represent amacroinstruction, assembly language instruction, machine codeinstruction, or other instruction or control signal of an instructionset of the processor. The instruction set is part of the instruction setarchitecture (ISA) of the processor and includes the native instructionsthat the processor is operable to execute.

In some embodiments, the bit shuffle instruction may explicitly specify(e.g., through one or more source operand specification fields or a setof source operand specification bits), or otherwise indicate (e.g.,implicitly indicate), a first source operand 110 that is to have atleast one lane of bits (e.g., a 16-bit, 32-bit, 64-bit, or 128-bit laneof bits). In some embodiments, each of the at least one lane of bits maybe a different packed data element (e.g., a 16-bit, 32-bit, or 64-bitinteger or other data element). In some embodiments, the instruction mayexplicitly specify, or otherwise indicate, a second source packed dataoperand that is to have a number of sub-lane sized bit selectionelements. The sub-lane sized bit selection elements may each have lessbits than each of the at least one lane of bits (e.g., each sub-lanesized bit selection element may have 8-bits, 6-bits, 5-bits, 4-bits, or3-bits,). As will be described further below, each of the sub-lane sizedbit selection elements is operative to specify or select an individualbit position in a corresponding lane. As one specific example, a 6-bitsized bit selection element may be operative to specify any one of sixtyfour different bit positions of a 64-bit lane (e.g., a 64-bit quadwordinteger). In one aspect, the 6-bit sized bit selection element may beincluded in an 8-bit byte but only six of the eight bits may be used forselection.

Referring again to FIG. 1, the processor includes a decode unit ordecoder 104. The decode unit may receive and decode the bit shuffleinstruction 102. The decode unit may output one or more relativelylower-level instructions or control signals (e.g., one or moremicroinstructions, micro-operations, micro-code entry points, decodedinstructions or control signals, etc.), which reflect, represent, and/orare derived from the relatively higher-level bit shuffle instruction. Insome embodiments, the decode unit may include one or more inputstructures (e.g., port(s), interconnect(s), an interface) to receive thebit shuffle instruction, an instruction recognition and decode logiccoupled therewith to recognize and decode the bit shuffle instruction,and one or more output structures (e.g., port(s), interconnect(s), aninterface) coupled therewith to output the lower-level instruction(s) orcontrol signal(s). The decode unit may be implemented using variousdifferent mechanisms including, but not limited to, microcode read onlymemories (ROMs), look-up tables, hardware implementations, programmablelogic arrays (PLAs), and other mechanisms used to implement decode unitsknown in the art. In some embodiments, instead of the bit shuffleinstruction being provided directly to the decode unit, an instructionemulator, translator, morpher, interpreter, or other instructionconversion module may optionally be used.

Referring again to FIG. 1, the processor 100 also includes a set ofpacked data registers 108. In some embodiments, the processor may alsooptionally include a set of packed data operation mask registers 116. Insome embodiments, the processor may also optionally include a set ofgeneral-purpose registers 118. Each of these registers may represent anon-die storage location that is operable to store data. The packed dataregisters may be operable to store packed data, vector data, or Singleinstruction, multiple data (SIMD) data. The packed data operation maskregisters, in some embodiments, may be operable to store results of bitshuffle instructions, and may also be operative to store packed dataoperation masks (e.g., predication masks). The packed data registers,packed data operation mask registers, and general-purpose registers mayeach represent architecturally-visible or architectural registers thatare visible to software and/or a programmer and/or are the registersindicated by instructions of the instruction set of the processor toidentify operands. These architectural registers are contrasted to othernon-architectural registers in a given microarchitecture (e.g.,temporary registers, reorder buffers, retirement registers, etc.). Theseregisters may be implemented in different ways in differentmicroarchitectures using well-known techniques and are not limited toany particular type of design. Examples of suitable types of registersinclude, but are not limited to, dedicated physical registers,dynamically allocated physical registers using register renaming, andcombinations thereof.

In some embodiments, the second source packed data operand 112, which isto have the number of sub-lane sized bit selection elements, mayoptionally be stored in one of the packed data registers 108.Alternatively, the second source packed data operand may optionally bestored in a memory location, or other storage location. As shown, insome embodiments, the first source operand 110, which is to have the atleast one lane of bits, may also optionally be stored in one of thepacked data registers 108 (e.g., if the first source operand is a packeddata operand). Alternatively, the first source operand 110 mayoptionally be stored in one of general-purpose registers 118 (e.g., ifthe first source operand has a single 16-bit, 32-bit, or 64-bit lane ofbits). In still other embodiments, the first source operand 110 mayoptionally be stored in memory (e.g., if the first source operand is apacked data operand or if the first source operand has a single scalarlane of bits).

Referring again to FIG. 1, an execution unit 106 is coupled with thedecode unit 104, the packed data registers 108, the general-purposeregisters 118, and the optional packed data operation mask registers116. The execution unit may receive the one or more decoded or otherwiseconverted instructions or control signals that represent and/or arederived from the bit shuffle instruction. The execution unit may alsoreceive the first source operand 110, which is to have the at least onelane of bits, and the second source packed data operand 112, which is tohave the number of sub-lane bit selection elements. The execution unitmay be operative in response to and/or as a result of the bit shuffleinstruction (e.g., in response to one or more instructions or controlsignals decoded from the bit shuffle instruction) to store the resultoperand 114 in a destination storage location that is to be indicated bythe bit shuffle instruction.

In some embodiments, the result operand 114 may include a differentcorresponding bit for each of the number of sub-lane sized bit selectionelements of the second source packed data operand 112. In someembodiments, a value of each bit of the result operand 114, whichcorresponds to a sub-lane sized bit selection element, may be equal inbit value to that of a selected, specified, or otherwise indicated bit,within a corresponding lane of bits, of the at least one lane of bits ofthe first source operand 110. The selected or indicated bit may beselected or indicated by the corresponding sub-lane sized bit selectionelement. For example, each sub-lane sized bit selection element of thesecond source packed data operand 112 may select or indicate a positionof a bit in a corresponding lane of the first source operand 110 whosevalue is to be included in bit of the result operand 114 thatcorresponds to the bit selection element of the second source packeddata operand 112. For example, the sub-lane sized bit selection elementmay have a value (e.g., a value of 23) to specify or indicate a bitposition (e.g., the twenty-third bit position) within the correspondinglane of bits. In some embodiments, all sub-lane sized bit selectionelements may correspond to the same single lane of the first sourceoperand. In other embodiments, different lanes of sub-lane sized bitselection elements may each correspond to a lane in a correspondingrelative position. In some embodiments, the result operant 114 may beany of those shown and described for FIGS. 3-8, although the scope ofthe invention is not so limited.

As shown, in the illustrated embodiment, the result operand 114 mayoptionally be stored in one of the packed data operation mask registers116, although this is not required. In other embodiments, the resultoperand may instead be stored in one of the general-purpose registers118. In still other embodiments, the result operand may be a resultpacked data operand, and may be stored in one of the packed dataregisters 108. Alternatively, memory or other storage locations may beused to store the result operand.

The execution unit and/or the processor may include specific orparticular logic (e.g., transistors, integrated circuitry, or otherhardware potentially combined with firmware (e.g., instructions storedin non-volatile memory) and/or software) that is operable to perform thebit shuffle instruction and/or store the result in response to and/or asa result of the bit shuffle instruction (e.g., in response to one ormore instructions or control signals decoded from the bit shuffleinstruction). By way of example, the execution unit may include alogical unit, an arithmetic logic unit, or a digital circuit to performlogical or bit manipulation operations, or the like. In someembodiments, the execution unit may include one or more input structures(e.g., port(s), interconnect(s), an interface) to receive sourceoperands, circuitry or logic coupled therewith to receive and processthe source operands and generate the result operand, and one or moreoutput structures (e.g., port(s), interconnect(s), an interface) coupledtherewith to output the result operand. In one possible implementation,the circuitry or logic to process the source operands and generate theresult operand may include a separate multiplexer or other selectionlogic for each lane that has lines or interconnects coupling all bits ofthe lane as inputs and a bit selection element as an input, and that isoperable to select a single bit of the lane indicated by the bitselection element and an output coupling the selected single bit to abit position in the result operand corresponding to the bit selectionelement.

Advantageously, the bit shuffle instruction may be used to accelerateand/or improve the performance of bit manipulation operations inprocessors. These bit manipulation operations are in widespread use insuch applications as packet processing, cryptography, matrixtransposition, and the like. Each bit selection element of the secondsource packed data operand 112, of which there may optionally be afairly large number (e.g., at least sixteen, at least thirty-two, etc.)may allow a single individual bit to be selected and stored bitwise fromthe first operand to the result operand within the confines of theexecution of a single instruction. This may allow the individual bits tobe moved around or rearranged with great flexibility (e.g., allowingfull shuffles in which every bit is potentially moved to a differentlocation by the single instruction). In one specific example, each of64-bits of the first source operand may be shuffled to a different bitposition in the result operand using sixty-four different bit selectionelements of the second source packed data operand within the confines ofa single instruction. Moreover, the instruction may be operative tocause the processor to manipulate individual bits, rather than needingto manipulate or operate on the whole data element or lane for each bitvalue obtained (e.g., there is no need to rotate or shift the whole dataelement or lane for each individual bit value obtained).

To avoid obscuring the description, a relatively simple processor 100has been shown and described. However, the processor may optionallyinclude other well-known processor components. Possible examples of suchcomponents include, but are not limited to, general-purpose registers, astatus register (sometimes called a flags register), system controlregisters, an instruction fetch unit, prefetch buffers, one or morelevels of cache (e.g., a level 1 (L1) instruction cache, an L1 datacache, and an L2 data/instruction cache), an instruction translationlookaside buffer (TLB), a data TLB, a branch prediction unit,out-of-order execution units (e.g., an instruction scheduling unit, aregister rename and/or allocation unit, an instruction dispatch unit, areorder buffer (ROB), a reservation station, a memory order buffer, aretirement unit, etc.), a bus interface unit, an address generationunit, a debug unit, a performance monitor unit, a power management unit,other components included in processors, and various combinationsthereof. Such components may be coupled together in various differentsuitable combinations and/or configurations known in the arts.Embodiments are not limited to any known such combination orconfiguration. Moreover, embodiments may be included in processors havemultiple cores at least one of which is operative to perform a bitshuffle instruction.

FIG. 2 is a block flow diagram of an embodiment of a method 220 in aprocessor of performing an embodiment of a bit shuffle instruction. Insome embodiments, the method 220 may be performed by and/or within theprocessor 100 of FIG. 1. The components, features, and specific optionaldetails described herein for the processor 100 also optionally apply tothe method 220. Alternatively, the method 220 may be performed by and/orwithin a similar or different processor or apparatus. Moreover, theprocessor 100 may perform methods the same as, similar to, or differentthan method 220.

The method includes receiving the bit shuffle instruction, at block 221.In various aspects, the instruction may be received at a processor or aportion thereof (e.g., an instruction fetch unit, a decode unit, a businterface unit, etc.). In various aspects, the instruction may bereceived from an off-processor and/or off-die source (e.g., from memory,interconnect, etc.), or from an on-processor and/or on-die source (e.g.,from an instruction cache, instruction queue, etc.). In someembodiments, the bit shuffle instruction may specify or otherwiseindicate a first source operand having at least one lane of bits, or insome cases a plurality of lanes of bits. The instruction may alsospecify or otherwise indicate a second source packed data operand havinga number of sub-lane sized bit selection elements.

A result operand may be generated and stored in a destination storagelocation indicated by the bit shuffle instruction in response to and/oras a result of the bit shuffle instruction (e.g., as a result ofdecoding the bit shuffle instruction), at block 222. In someembodiments, the result operand may include a different correspondingbit for each of the number of sub-lane sized bit selection elements. Insome embodiments, a value of each bit of the result operand thatcorresponds to a sub-lane sized bit selection element, may be equal tothat of a selected, specified, or otherwise indicated bit, of acorresponding lane of bits, of the at least one lane of bits of thefirst source operand. The selected or indicated bit may be selected orindicated by the corresponding sub-lane sized bit selection element.

In some embodiments, all sub-lane sized bit selection elements maycorrespond to the same single lane of bits of the first source operand.In other embodiments, multiple lanes of sub-lane sized bit selectionelements may each correspond to a different corresponding lane of a setof lanes of the first source operand.

In some embodiments, the destination storage location may be a packeddata operation mask register that may be used by other instructions ofthe instruction set to store packed data operation masks (e.g.,predication masks). In other embodiments, the destination storagelocation may be a packed data register and the bits of the resultoperand may be included in different lanes corresponding to differentlanes of the second source packed data operand.

The illustrated method involves architectural operations (e.g., thosevisible from a software perspective). In other embodiments, the methodmay optionally include one or more microarchitectural operations. By wayof example, the instruction may be fetched, decoded, scheduledout-of-order, source operands may be accessed, an execution unit mayperform microarchitectural operations to implement the instruction, etc.In some embodiments, the microarchitectural operations to implement theinstruction may optionally include any of these described below inconjunction with FIGS. 3-8, although the scope of the invention is notso limited.

FIG. 3 is a block diagram illustrating an embodiment of a bit shuffleoperation 330 that may be performed in response to an embodiment of abit shuffle instruction. The instruction may specify or otherwiseindicate a first source operand 310, and may specify or otherwiseindicate a second source packed data operand 312. In variousembodiments, the width or size of the first source packed data operandmay be 16-bits, 32-bits, 64-bits, 128-bits, 256-bits, 512-bits, or1024-bits, although the scope of the invention is not so limited. Thefirst source operand has at least one lane of bits. As shown in theillustration, in some embodiments, the first source operand may have afirst lane of bits 332-1 and an optional second lane of bits 332-2. Invarious embodiments, each of these lanes of bits may have 16-bits,32-bits, 64-bits, or 128-bits, although the scope of the invention isnot so limited.

The second source packed data operand has a number of sub-lane sized bitselection elements S₀ to S_(2N+1) (collectively S). The total number ofthese sub-lane sized bit selection elements may be any number desiredfor the particular implementation. In some embodiments, each sub-lanesized bit selection element may have 4-bits, 5-bits, 6-bits, 7-bits, or8-bits, although the scope of the invention is not so limited. In someembodiments, each sub-lane sized bit selection element may be includedin a different corresponding 8-bit byte of the second source packed dataoperand. For example, each sub-lane sized bit selection element may have4-bits, 5-bits, 6-bits, or 7-bits and may be included in a differentcorresponding byte. Representatively, only the 4, 5, 6, or 7least-significant bits (or alternatively the 4, 5, 6, or 7most-significant bits) of each byte may be used for bit selection. Forexample, only the least-significant 6-bits of each corresponding 8-bitbyte may be used for bit selection, while the remaining most significant2-bits of each byte may optionally be ignored (or at least not used forbit selection). In such cases, the number of sub-lane sized bitselection elements may be equal to the size in bits of the second sourcepacked data operand divided by 8-bits. Alternatively, two 4-bit nibblesized bit selection elements may optionally be included in each 8-bitbyte. In various embodiments, the width or size of the second sourcepacked data operand may be 64-bits, 128-bits, 256-bits, 512-bits, or1024-bits, although the scope of the invention is not so limited. The64-bit, 128-bit, 256-bit, 512-bit, and 1024-bit second source packeddata operands may, respectively, include eight, sixteen, thirty two,sixty four, or one hundred twenty eight bytes. In some embodiments,there may be at least sixteen sub-lane sized bit selection elements inthe second source packed data operand.

In embodiments where the instruction/operation uses only a single laneof bits of the first source operand 310, all of the number of sub-lanesized bit selection elements (e.g., S₀ to S_(2N+1)) may correspond tothe single lane of bits (e.g., the first lane 332-1). Alternatively, inother embodiments the instruction/operation may use multiple lanes ofbits that are either part of the first source operand 310 or are derivedfrom the first source operand (e.g., broadcast or otherwise replicatedfrom the first source operand). For example, the instruction mayindicate the first source operand having a single lane of bits that isto be broadcast or replicated into multiple lanes of bits that are to beused by the instruction/operation. In such embodiments where theinstruction/operation uses multiple lanes of bits, the sub-lane sizedbit selection elements may be logically grouped or apportioned intodifferent subsets, with each subset corresponding to a different lane ofbits. In such cases, each subset of bit selection elements may be usedto select, specify, or otherwise identify bits of the first sourceoperand within only the corresponding lane of bits. For example, thesub-lane sized bit selection elements S₀ to S_(N) may correspond to, andmay be used to identify bits within only the first lane of bits 332-1,while the sub-lane sized bit selection elements S_(N+1) to S_(2N+1) maycorrespond to, and may be used to identify bits within only the secondlane of bits 332-2.

A result operand 314 may be generated (e.g., by an execution unit 306)and stored in a destination storage location in response to the bitshuffle instruction/operation. The destination storage location may bespecified or otherwise indicated by the instruction. In someembodiments, the result operand may include a different correspondingbit for each of the number of sub-lane sized bit selection elements ofthe second source packed data operand. For example, bit[0] of the resultoperand may correspond to bit selection element S₀, bit[1] of the resultoperand may correspond to bit selection element S₁, and so on. In someembodiments, the result operand may also include additional bits (e.g.,replicated copies of bits), as will be described further below. In someembodiments, a value of each bit of the result operand (at least thosebits that corresponds to a sub-lane sized bit selection element) may beequal to that of a bit of a corresponding lane of bits, of the at leastone lane of bits of the first source operand, which is specified,selected, or otherwise indicated by the corresponding sub-lane sized bitselection element. For example, each bit selection element may select abit position in a corresponding lane of bits of the first sourceoperand, and the value of the bit at that position may be stored to theappropriate corresponding bit position for that bit selection element inthe result operand. For example, in the illustrated example embodiment,the bit selection element 50 may have a value of three (3) to identifybit[3] of the first lane of bits 332-1 having a value of binary one (1),bit selection element S1 may have a value of four (4) to identify bit[4]of the first lane of bits 332-1 having a value of binary zero (0)(noting that bit[0] is the first bit), and so on. In some embodiments,the destination storage location used to store the result operand may bea packed data operation mask register. In other embodiments, thedestination storage location may be a general-purpose register.Alternatively, memory locations or other storage locations mayoptionally be used, if desired.

FIG. 4 is a block diagram illustrating an embodiment of a bit shuffleoperation 440 that may be performed to shuffle bits of 64-bit lanes(e.g., having quadword (QWORD) integers) of a first source packed dataoperand 410 using 8-bit byte sized bit selection elements in a secondsource packed data operand 412 to generate a scalar result operand 414.The operation may be performed in response to an embodiment of a bitshuffle instruction. The instruction may specify or otherwise indicatethe first source packed data operand, and may specify or otherwiseindicate the second source packed data operand.

In this embodiment, the first source packed data operand 410 has atleast 128-bits, optionally up to 512-bits, and has multiple lanes ofbits 432. Specifically, in the illustrated embodiment, the first sourcepacked data operand has a first 64-bit lane of bits 432-0, a second64-bit lane of bits 432-1, optionally up to an eighth 64-bit lane ofbits 432-7. In one aspect, these at least two (or up to eight) 64-bitlanes may each be operable to hold a corresponding one of at least two(or up to eight) 64-bit quadword integers (e.g., QWORD0 to QWORD7).

In this embodiment, the second source packed data operand 412 has atleast 128-bits, optionally up to 512-bits, and has a number of 8-bitbyte sized bit selection elements (B). Specifically, in the illustratedembodiment, the second source packed data operand has at least sixteen8-bit byte sized bit selection elements (B0 to B15) in the leastsignificant 128-bits. Optionally, the second source packed data operandmay have up to sixty-four 8-bit byte sized bit selection elements (B0 toB63) in an operand of size up to 512-bits. As previously mentioned, insome embodiments, not all of the 8-bits of a byte sized bit selectionelement may be used for bit selection. For example, in some embodiments,only a least significant (or alternatively most significant) 4, 5, 6, or7-bits of each byte may be used for bit selection. One advantage tousing 6-bits for bit selection, especially with 64-bit lanes and/or64-bit quadword (QWORD) integers, is that the 6-bits are sufficient touniquely identify any single one of the 64-bits of the lane and/orQWORD. For example, the least significant 6-bits of byte B0 may uniquelyidentify any one of the 64-bits in the first 64-bit lane 432-0 and/orQWORD0.

In the illustrated embodiment, the 8-bit byte sized bit selectionelements are grouped or apportioned into a plurality of groups orsubsets that each correspond to a different one of the lanes 432 and/orQWORDs. For example, a first subset of eight bit selection elements B0to B7 correspond to the first 64-bit lane 432-0, a second subset ofeight bit selection elements B8 to B15 correspond to the second 64-bitlane 432-1, up through an eighth subset of eight bit selection elementsB56 to B63 corresponding to the eighth 64-bit lane 432-7. Each subset ofbit selection elements may be used to select or identify bits withinonly a corresponding lane of bits and/or QWORD. For example, each of B0to B7 may be used to identify a bit position within only the first64-bit lane 432-0, each of B8 to B15 may be used to identify a bitposition within only the second 64-bit lane 432-1, and so on. Eachsubset of eight bit selection elements and/or each 64-bit lane of thesecond source packed data operand 412 is operative to select eightpotentially/optionally different bit positions in a corresponding 64-bitlane of the first source packed data operand.

A result operand 414 may be generated (e.g., by an execution unit 406),and stored in a destination storage location, in response to the bitshuffle instruction/operation 440. In some embodiments, the resultoperand may include a different corresponding bit for each of the numberof 8-bit byte sized bit selection elements of the second source packeddata operand. For example, in the illustrated embodiment, the resultoperand is a 64-bit operand that includes a different bit for each ofthe sixty-four byte sized bit selection elements B0-B63.Representatively, the result bits and their corresponding bit selectionelements may be in same relative positions within the operands. Forexample, bits[7:0] of the result operand may correspond respectively tobytes B7-B0, bits[15:8] of the result operand may correspondrespectively to bytes B15-B8, bits[63:58] of the result operand maycorrespond respectively to bytes B63-B56, and so on. As shown, in someembodiments, the result bits corresponding to all of the bit selectionelements for all of the lanes may be concatenated together and storedadjacent to one another in a contiguous set of bits in the resultoperand. In such embodiments, the result operand is not a packed dataoperand, but rather a scalar operand (e.g., a single scalar 64-bit QWORDinteger). In some embodiments, a value of each bit of the result operandmay be equal to that of a bit of a corresponding lane of bits of thefirst source packed data operand, which is specified, selected, orotherwise indicated by the corresponding 8-bit byte sized bit selectionelement. Each bit selection element of the second source packed dataoperand may identify a bit position in a corresponding lane of bits ofthe first source operand, and the value of the bit at that identifiedbit position may be stored in the bit position of the result operandthat corresponds to (e.g., is in a same relative position as) the bitselection element. For example, B0 may have a value 58 to indicatebit[58] of the first lane 432-0 which has a value of binary one, and avalue of binary one may be stored in bit[0] of the result operand sincebit[0] corresponds to B0, B1 may have a value 15 to indicate bit[15] ofthe first lane 432-0 which has a value of binary zero, and a value ofbinary zero may be stored in bit[1] of the result operand, and so on.

As shown, in some embodiments, the second source packed data operand 412may have a same number of bit selection elements (e.g., sixty four) as anumber of bits in a lane of bits (e.g., a 64-bit lane of bits) of thefirst source operand. In one possible use of the instruction/operation,identical copies or replicas of the same value (e.g., the same 64-bitvalue) may optionally be stored in each of the lanes (e.g., eight 64-bitlanes) of the first source packed data operand. By way of example, theremay be sixty-four bit selection elements such that each and every one ofthe bits of a single 64-bit value may be identified by a differentcorresponding one of the sixty-four bit selection elements.Advantageously, this may allow a full 64-bit bit shuffle or permute tobe performed on the single 64-bit value within the confines of theexecution of the single bit shuffle instruction. Conventionally, asdiscussed in the background section, many more instructions (e.g., shiftor rotate instructions, logical AND or logical OR instructions, etc.)would generally be needed in order to perform such a full 64-bit bitshuffle. Moreover, to further facilitate such a possible use case, analternate embodiment of the bit shuffle instruction is contemplated inwhich it optionally indicates a first source operand having a singlescalar lane of bits (e.g., a single scalar 64-bit value), and theinstruction may causes the processor to broadcast or otherwise replicatethe single scalar lane of bits to create multiple (e.g., eight) copiesof the lane of bits each in a different corresponding lane.

Other uses of the instruction/operation are also contemplated. Forexample, different values (e.g., different 64-bit quadword integers) mayoptionally be stored in the different lanes of the first source packeddata operand. The instruction/operation may perform a partial bitshuffle on each of the different values (e.g., shuffle only 8-bits ofeach of the eight different 64-bit values) in parallel. Multiple (e.g.,eight) instructions may be used to collectively perform a full bitshuffle (e.g. a full 64-bit bit shuffle) on the different values. Thepartial (e.g., 8-bit) bit shuffle results may then be merged or combinedin order to form the full 64-bit bit shuffled result.

The result operand 414 may be stored in a destination storage locationthat is specified or otherwise indicated by the instruction. In someembodiments, the destination storage location may optionally be a packeddata operation mask register. The packed data operation mask registermay be dedicated primarily to storing packed data operation masks and/orfor use in predication, rather than being more general-purpose like ageneral-purpose register (e.g., also used for address generation, etc.).A plurality of other instructions, of an instruction set of theprocessor, may specify the same packed data operation mask register as apredicate operand to predicate a corresponding packed data operation.These instructions may specify the packed data operation mask registerin a different field or set of bits of the instruction than those usedto specify general-purpose registers, packed data registers, and othernon-packed data operation mask registers. Alternatively, in otherembodiments, the destination storage location used for the resultoperand 414 may optionally be a general-purpose register. One possibleadvantage of using a packed data operation mask register over ageneral-purpose register is that in some processor microarchitecturesthe mask registers tend to be more closely located with other packeddata resources (e.g., packed data registers, packed data executionunits, etc.) than the general-purpose registers. In still otherembodiments, memory locations or other storage locations may optionallybe used, if desired.

It is to be appreciated that this is just one illustrative example of asuitable bit shuffle operation/instruction. Other embodiments may useother sized packed data operands. Examples of suitable packed dataoperand sizes include, but are not limited to, 128-bits, 256-bits,512-bits, and 1024-bits. Moreover, in other embodiments, fewer (e.g.,two) or more lanes (e.g., six, eight) may optionally be used and/orother sized lanes besides 64-bit lanes may optionally be used, such as,for example, 16-bit lanes, 32-bit lanes, and other sized lanes. Also,different sized bit selection elements may optionally be used. Suitablesized bit selection elements include, for example, 8-bit, 7-bit, 6-bit,5-bit, and 4-bit nibble sized bit selection elements. Still othervariations and alternatives mentioned elsewhere herein are suitableand/or would be apparent to those skilled in the art having the benefitof the present disclosure.

FIG. 5 is a block diagram of an embodiment of a bit shuffle operation550 that may be performed to shuffle bits of 16-bit lanes (e.g., having16-bit word integers) of a first source packed data operand 510 using4-bit nibble sized bit selection elements in a second source packed dataoperand 512 to generate a scalar result operand 514. The operation maybe performed in response to an embodiment of a bit shuffle instruction.The operation/instruction of FIG. 5 has certain similarities to theoperation/instruction of FIG. 4. To avoid obscuring the description, thediscussion below will primarily focus on the different and/or additionalfeatures of the operation/instruction of FIG. 5, without repeating allof the features that may be the same as or similar to those of theoperation/instruction of FIG. 4. However, it is to be appreciated thatthe previously described features and details of theoperation/instruction of FIG. 4 may also optionally apply to theoperation/instruction of FIG. 5, unless stated or otherwise clearlyapparent.

The instruction may specify or otherwise indicate the first sourcepacked data operand 510 and the second source packed data operand 512.In this embodiment, the first source packed data operand is 64-bits wideand has four 16-bit lanes of bits. These four lanes include a first16-bit lane 532-0 that may be used to store a first 16-bit word (WORD0),a second 16-bit lane 532-1 that may be used to store a second 16-bitword (WORD1), a third 16-bit lane 532-2 that may be used to store athird 16-bit word (WORD2), and a fourth 16-bit lane 523-3 that may beused to store a fourth 16-bit word (WORD3).

In this embodiment, the second source packed data operand 512 also has64-bits. The second source packed data operand has sixteen 4-bit nibblesized bit selection elements N0-N15. A first subset or group of four4-bit nibble bit selection elements N0 to N3 correspond to the firstlane 532-0, a second subset of four 4-bit nibble bit selection elementsN4 to N7 correspond to the second lane 532-1, a third subset of four4-bit nibble bit selection elements N8 to N11 correspond to the thirdlane 532-2, and a fourth set of four 4-bit nibble bit selection elementsN12 to N15 correspond to the fourth lane 532-3. Each subset of the 4-bitnibble bit selection elements may be used to select or identify bitsfrom within only a corresponding 16-bit word and/or 16-bit lane. Each4-bit nibble bit selection element may be able to uniquely identify anysingle bit in a corresponding 16-bit word and/or 16-bit lane.

A result operand 514 may be generated (e.g., by an execution unit 506)and stored in a destination storage location in response to the bitshuffle instruction/operation 550. The illustrated result operand has16-bits. In some embodiments, the result operand may include a differentcorresponding bit for each of the sixteen 4-bit nibble bit selectionelements. As shown, in some embodiments, the bits corresponding to allsixteen of the 4-bit nibble bit selection elements for all the lanes maybe concatenated together and stored adjacent to one another in acontiguous set of 16-bits in the result operand. In some embodiments, avalue of each bit of the result operand may be equal to that of a bit ofa corresponding lane of bits of the first source packed data operand,which is specified, selected, or otherwise indicated by thecorresponding 4-bit nibble bit selection element. For example, N0 mayhave a value of 4 to indicate bit[4] of the first lane 532-0 which has avalue of binary one, and a value of binary one may be stored in bit[0]of the result operand since it corresponds to NO, and so on. In someembodiments, the second source packed data operand may have the samenumber of bit selection elements (e.g., sixteen) as a number of bits ineach lane (e.g., a 16-bit lane) of the first source operand. In someembodiments, the destination storage location used to store the resultoperand may optionally be a packed data operation mask register.Alternatively, the destination storage location may optionally be ageneral-purpose register, a memory location, or other storage location.

FIG. 6 is a block diagram of an embodiment of a data element broadcastoperation 660 that may optionally be combined with a bit shuffleoperation 640. The operation may be performed in response to anembodiment of a bit shuffle with data element broadcast instruction. Insome embodiments, the instruction may optionally have broadcastindication control (e.g., a set of one or more bits or a field) toindicate that data element broadcast is to be performed. In otherembodiments, the data element broadcast operation may optionally beimplicit to the instruction (e.g., implicit to an opcode). Theinstruction may indicate a source operand 610 having a single dataelement 632 (e.g., a 64-bit quadword, a 16-bit word, etc.) that is to bebroadcast or replicated. The source operand may be a scalar operandhaving only a single data element, as opposed to a packed data operandhaving a plurality of data elements. In some embodiments, the singledata element 632 may optionally be stored in a memory location 662(e.g., in main memory), although this is not required. In suchembodiments, the single data element may first be accessed from thememory location (e.g., through a load or other memory access operationdecoded or otherwise derived from the bit shuffle with data elementbroadcast instruction).

The single data element may then be broadcast or replicated 664 multipletimes to create multiple copies of the single data element. In theillustration, this includes creating a first replicated data element668-1 optionally through an Nth replicated data element 668-N. Thenumber of such replicas may be any of the previously described number ofdata elements. In some embodiments, a different replica or copy of thesingle data element 632 may be created for each lane and/or data elementof another source packed data operand indicated by the instruction(e.g., the second source packed data operand having different subsets ofbit selection elements for each lane and/or data element).

In the illustration, the multiple replicas or copies of the data elementare shown together in a temporary source packed data operand 662. Thistemporary source packed data operand is shown in dashed lines toindicate that, in some embodiments, the replicas or copies of the singledata element may be stored together in a temporary register or othernon-architectural storage location, but in other embodiments thereplicas or copies of the data element may not ever actually be storedtogether in a register or storage location but instead may merely beprovided to the execution unit. The broadcast or replicated dataelements 668-1 through 668-N and/or the temporary source packed dataoperand 662 may be provided to a bit shuffle operation 640. The bitshuffle operation 640 may represent any of the bit shuffle operationsdescribed elsewhere herein (e.g., one of the bit shuffle operations 330,440, 550). The bit shuffle operation may be performed on the broadcastor replicated data elements substantially as has been described for thesource packed data operands previously described.

Advantageously, incorporating the data element broadcast operation withthe bit shuffle operation may help to increase the efficiency of variousapplications where it is desired to use the same single data element orvalue for each of multiple vector, packed data, or SIMD subsets of bitselection elements. As previously described, this may allow, in oneaspect, using the different subsets of bit selection elements to selectdifferent sets of bits from the replicate copies of the data element orlane in order to perform a full bitwise shuffle of all of the bits ofthe data element or lane, although the scope of the invention is not solimited (e.g., an alternate use could be to select the same sets of bitsfor each of the different lanes or data elements of the result operand).

To further illustrate certain concepts, consider the following detailedexample embodiments for a bit shuffle instruction to store a resultoperand that includes all bits selected by all bit selection elementsconcatenated together and which is stored in a packed data operationmask register. This instruction is named VPSHUFBITQMB and has asoperands a DEST, a SRC1, and a SRC2. In some embodiments, theinstruction may allow SRC1 to be a packed data register, SRC2 to beeither a packed data register or a memory location, and DEST to be amask register. Alternatively, a general-purpose register could be usedfor DEST instead of a mask register. Table 1 lists opcodes, encodings,and operation descriptions for several different embodiments of thisinstruction.

TABLE 1 VPSHUFBITQMB - Shuffle Bits in Packed Quadword Integers - MaskRegister Destination Opcode/Instruction Operation DescriptionEVEX.NDS.128.F3.0F38.W1 B9/r Using unsigned 6-bit indices fromVPSHUFBITQMB k1, xmm2, first source, gather bit values fromxmm3/m128/m64bcst second source EVEX.NDS.256.F3.0F38.W1 B9/r Usingunsigned 6-bit indices from VPSHUFBITQMB k1, ymm2, first source, gatherbit values from ymm3/m256/m64bcst second source EVEX.NDS.512.F3.0F38.W1B9/r Using unsigned 6-bit indices from VPSHUFBITQMB k1, zmm2, firstsource, gather bit values from zmm3/m512/m64bcst second source

EVEX refers to an EVEX encoding as described elsewhere herein Xmm, ymm,and zmm respectively represent 128-bit, 256-bit, and 512-bit packed dataregisters. The m128/m256/m512 refer respectively to 128-bit, 256-bit,and 512-bit memory locations. The m64bcst refers to a 64-bit memorylocation on which data element broadcast to multiple elements of avector is to be performed. The k1 operand specifies a mask register(e.g., one of mask registers k0-k7) used as a destination storagelocation.

The VPSHUFBITQMB instruction may be used to rearrange or shuffle bits ofpacked quadword integers in a second source packed data operand (SRC2)based on bit selection controls in a first source packed data operand(SRC1), and store the shuffled bits in a destination (DEST). In oneembodiment, the instruction may use unsigned 6-bit indices, each withina different corresponding byte of the first source operand (SRC1), toselect and gather bit values from a corresponding quadword integer ofthe second source operand (SRC2). Each 6-bit index is operative tospecify any one of sixty-four different bit locations in a singlequadword. The value of the 6-bit index selects the bit value at theindexed bit location. The bit selection control data for each output bitis stored in 8-bit byte elements of the first source operand (SRC1), butonly the least significant 6-bits of each byte are used for bitselection. Each 6-bit index is limited to bit selection within acorresponding quadword occupying the corresponding bit positions. Forexample, the least significant eight bytes of SRC1 select bits withinthe least significant quadword of SRC2, the most significant eight bytesof SRC1 select bits within the most significant quadword of SRC2, and soon.

An example of pseudocode for an embodiment of the VPSHUFBITQMBinstruction is shown below. SRC2 represents a first source packed dataoperand, SRC3 represents a second source packed data operand, and DESTrepresents a destination. The k1 operand represents a packed dataoperation mask register to be used as a destination storage location. Inthe pseudocode, KL represents a mask length and/or the number of dataelement positions within a packed data operand, VL represents a lengthof the vectors or packed data operands, “i” represents a positioncounter to select a quadword or lane to be used for the iteration, and“j” represents a position counter to select a byte within the lane.EVEX.b==1 configures embedded broadcast when SRC3 *is memory*. Theparameter “m” represents the bit position within the appropriatequadword of SRC3 indicated by the appropriate byte of SRC2. Otherembodiments may implement the instructions using different sets ofmicroarchitectural operations.

VPSHUFBITQMB DEST, SRC1, SRC2   (KL, VL) = (16, 128), (32, 256), (64,512) FOR i := 0 TO KL/8-1; Qword  FOR j := 0 to 7 ; Byte   IF EVEX.b ANDSRC2 *is memory*   THEN    Data := SRC2.qword[0];   ELSE    Data :=SRC2.qword[i]   m := SRC1.qword[i].byte[j] & 0x3F   k1[i*8+j] :=Data.bit[m]  ENDFOR; ENDFOR; k1[MAX_KL-1:KL] := 0;

It is to be appreciated that these are just a few example embodiments ofsuitable instructions. Other embodiments may use either narrower (e.g.,64-bit) or wider (e.g., 1024-bit) or just differently sized packed dataoperands. Still other embodiments may use different sized lanes besidesquadword-sized lanes (e.g., 16-bit or 32-bit lanes) and/or differentsized indexes (e.g., 4-bit nibble indexes, 5-bit indexes, etc.). Inalternate embodiments, other storage locations (e.g. memory locations)may be used for operands. Other embodiments may optionally omitmasking/predication. Other embodiments may optionally omit data elementbroadcast.

FIG. 7 is a block diagram of an embodiment of a bit shuffle operation770 that may be performed to shuffle bits of 64-bit lanes (e.g., having64-bit quadword (QWORD) integers) of a first source packed data operand710 using 8-bit byte sized bit selection elements in a second sourcepacked data operand 712 to generate a result packed data operand 714.The operation may be performed in response to an embodiment of a bitshuffle instruction. The operation/instruction of FIG. 7 has certainsimilarities to the operation/instruction of FIG. 4 except that a packeddata result operand 714 is generated instead of a scalar result operand414. To avoid obscuring the description, the discussion below willprimarily focus on the different and/or additional features of theoperation/instruction of FIG. 7, without repeating all of the featuresthat may be the same as or similar to those of the operation/instructionof FIG. 4. However, it is to be appreciated that the previouslydescribed features and details of the operation/instruction of FIG. 4may also optionally apply to the operation/instruction of FIG. 5, unlessstated or otherwise clearly apparent (e.g., unless they pertain to theresult packed data operand 714 as opposed to the scalar result operand414).

The instruction may specify or otherwise indicate the first sourcepacked data operand 710. The first source packed data operand may havemultiple 64-bit lanes of bits 732 and/or 64-bit quadword (QWORD)integers. The instruction may also specify or otherwise indicate thesecond source packed data operand 712. The second source packed dataoperand may have multiple corresponding subsets of 8-bit byte sized bitselection elements (B). The first and second packed data operands may besimilar to, or the same as, those previously described for FIG. 4, andmay have similar variations.

A result packed data operand 714 may be generated (e.g., by an executionunit 706), and stored in a destination storage location, in response tothe bit shuffle instruction/operation 770. In contrast to the unpackedresult operand 414 of FIG. 4, the result operand 714 is a packed dataoperand. The result packed data operand may be stored in a packed dataregister (e.g., one of registers 108 or 1008), as a packed data operandin a memory location, or other storage location capable of storingpacked data. The result packed data operand may have a plurality oflanes of bits that each correspond to a different lane of bits of thefirst source packed data operand 710 and/or each correspond to adifferent subset of the 8-bit byte sized bit selection elements of thesecond source packed data operand 712. For example, bits[63:0] of theresult packed data operand may correspond to the first 64-bit lane732-0, bits[127:64] of the result packed data operand may correspond tothe second 64-bit lane 732-1, and so on. In the illustration, the lanesof bits of the result packed data operand have the same size as thelanes of bits of the first source packed data operand, although this isnot required (e.g., they may instead be either larger (e.g., 128-bits)or smaller (e.g., 32-bits)).

In some embodiments, the bits selected by each subset of the 8-bit bytesized bit selection elements may be stored in a corresponding lane ofbits of the result packed data operand. In some embodiments, the resultbits, and their corresponding bit selection elements, may be in samerelative positions in their lanes. For example, bits[7:0] of the resultpacked data operand may correspond respectively to bit selectionelements B7-B0, bits[71:64] of the result packed data operand maycorrespond respectively to bytes B15-B8, and so on. In some embodiments,a value of each of bits[7:0] of the result packed data operand may beequal to a bit of the corresponding first lane 732-0 that is specified,selected, or otherwise indicated by the corresponding bit selectionelement of B7-B0 in the same relative position. For example, bits[7:0]of the result packed data operand may have 8-bits of QWORD0 selected bybit selection elements B7-B0, bits[71:64] of the result packed dataoperand may have 8-bits of QWORD1 selected by bit selection elementsB15-B8, and bits[455:448] of the result packed data operand may have8-bits of QWORD7 selected by bit selection elements B63-B56. Notice thatonly some of the bits in each lane of the result packed data operand areneeded to store all of the bits selected by the subset of bit selectionelements for the corresponding lane. In the illustrated example, thereare eight bit selection elements for each lane, and so only 8-bits areneeded in each lane of the result packed data operand to store all thebits selected for the corresponding lane. For example, result bits[7:0]are used for the first lane 732-0, result bits[71:64] are used for thesecond lane 732-1, and so on. In the illustrated embodiment, theseresult bits are optionally stored in the least significant or lowestorder bits of the corresponding lane. Alternatively, the mostsignificant bits, or some other subset of bits, may optionally be used.

As shown, in some embodiments, the second source packed data operand 712may have a same number of bit selection elements (e.g., sixty four) as anumber of bits in a lane of bits (e.g., a 64-bit lane of bits) of thefirst source operand. In one possible use of the instruction/operation,identical copies or replicas of the same value (e.g., the same 64-bitvalue) may optionally be stored in each of the lanes (e.g., eight 64-bitlanes) of the first source packed data operand. By way of example, sincethe single 64-bit value has 64-bits, and since there are sixty-four bitselection elements, each and every one of the bits of the single 64-bitvalue may be identified by a different corresponding one of thesixty-four bit selection elements. Advantageously, this may allow a full64-bit bit shuffle or permute to be performed on the single 64-bit valuewithin the confines of the execution of the single bit shuffleinstruction. Conventionally, as discussed in the background section,many more instructions of an algorithm would generally be needed inorder to perform such a full 64-bit bit shuffle. Moreover, to furtherfacilitate such a possible use case, an alternate embodiment of the bitshuffle instruction is contemplated in which it optionally indicates afirst source operand having a single scalar lane of bits (e.g., a singlescalar 64-bit value), and the instruction may causes the processor tobroadcast or otherwise replicate the single scalar lane of bits tocreate multiple (e.g., eight) copies of the lane of bits each in adifferent corresponding lane.

Other uses of the instruction/operation are also contemplated. Forexample, different values (e.g., different 64-bit quadword integers) mayoptionally be stored in the different lanes of the first source packeddata operand. The instruction/operation may perform a partial bitshuffle on each of the different values (e.g., shuffle only 8-bits ofeach of the eight different 64-bit values) in parallel. Multiple (e.g.,eight) instructions may be used to collectively perform a full bitshuffle (e.g. a full 64-bit bit shuffle) on the different values. Thepartial (e.g., 8-bit) bit shuffle results may then be merged or combinedin order to form the full 64-bit bit shuffled result.

Referring again to FIG. 7, in some embodiments, the remaining other bitsin each lane of the result packed data operand (i.e., those which arenot needed to store the bits selected by the bit selection elements) mayoptionally store one or more copies or replicas of the bits selected bythe bit selection elements corresponding to the same lane. For example,result bits[63:8] may store seven replicated copies of result bits[7:0],result bits[127:72] may store seven replicated copies of resultbits[71:63], result bits[511:456] may store seven replicated copies ofresult bits[448:455], and so on. To further illustrate, if resultbits[7:0] have the values 11111100 then result bits[63:0] may have thevalues 11111100 11111100 11111100 11111100 11111100 11111100 1111110011111100. The 8-bits selected for each lane may be replicated seventimes and eight identical copies of the 8-bits may be stored in thecorresponding lane. Possible advantages to storing such replicated setsof bits will be discussed further below (e.g., in conjunction with FIG.8). However, storing such replicated sets of bits is optional and notrequired. In other embodiments, various other predetermined values mayoptionally be stored in the remaining bits in each lane of the resultpacked data operand (i.e., those not needed to store the selected bits).Examples of such predetermined values include, but are not limited to,all zeroes, all ones, and merged bit values from corresponding bitpositions in the first source packed data operand. It is to beappreciated that this is just one illustrative example of a suitable bitshuffle operation/instruction. Other embodiments may use other sizedpacked data operands. Examples of suitable packed data operand sizesinclude, but are not limited to, 128-bits, 256-bits, 512-bits, and1024-bits. The first, second, and result packed data operands may have,but are not required to have, the same sized packed data operands.Moreover, in other embodiments, fewer lanes (e.g., two) or more lanes(e.g., six, eight, etc.) may optionally be used. Further, other sizedlanes besides 64-bit lanes may optionally be used, such as, for example,16-bit lanes, 32-bit lanes, or other sized lanes desired for theparticular implementation. Also, different sized bit selection elementsmay optionally be used. Suitable sized bit selection elements include,for example, 8-bit, 7-bit, 6-bit, 5-bit, and 4-bit nibble sized bitselection elements. Still other variations and alternatives mentionedelsewhere herein are suitable and/or would be apparent to those skilledin the art having the benefit of the present disclosure.

FIG. 8 is a block diagram of an embodiment of a masked bit shuffleoperation 880 to shuffle bits of a 64-bit lane of a first source packeddata operand 810 using 8-bit byte sized bit selection elements in asecond source packed data operand 812 subject to a source packed dataoperation mask operand 882 to generate a result packed data operand 814.The masked operation may be performed in response to an embodiment of amasked bit shuffle instruction. The masked operation of FIG. 8 hascertain similarities to the unmasked operations of FIGS. 4 and 7. Toavoid obscuring the description, the different and/or additionalcharacteristics for the masked operation of FIG. 8 will primarily bedescribed, without repeating all the optionally similar or commoncharacteristics and details relative to the unmasked operations of FIGS.4 and 7. However, it is to be appreciated that the previously describedcharacteristics and details of the unmasked operations of FIGS. 4 and 7may also optionally apply to the masked operation of FIG. 8, unlessstated otherwise or otherwise clearly apparent.

The masked instruction may specify or otherwise indicate a first sourcepacked data operand 810, and a second source packed data operand 812.Each of these operands may be similar to, or the same as, thecorresponding operands of FIGS. 4 and/or 7, and may have the samevariations and alternatives. The first source packed data operand has afirst 64-bit lane of bits 832. The second source packed data operand hasa group or subset of eight 8-bit byte sized bit selection elements B0 toB7 corresponding to the first lane of bits.

The masked bit shuffle instruction additionally specifies (e.g.,explicitly specifies) or otherwise indicates (e.g., implicitlyindicates) a source packed data operation mask operand 882. The packeddata operation mask operand may also be referred to herein simply as anoperation mask operand, predicate mask operand, predicate operand, maskoperand, or simply as a mask. The mask may include multiple maskelements, predicate elements, or conditional control elements. As shown,in some embodiments, each mask element may be a single mask bit.Alternatively, two or more bits may optionally be used for each maskelement. Each of the mask elements may be used to predicate,conditionally control, or mask whether or not a corresponding result isto be stored in a corresponding location. In one aspect, each of themask elements may correspond to a different one of a plurality ofsub-lane sized portions of a corresponding lane of the result packeddata operand in a same relative position within the operands. In someembodiments, each of the corresponding sub-lane sized portions of theresult packed data operand may have a width in bits sufficient to holdall bits selected by a subset of bit selection elements for thecorresponding lane (e.g., may be sufficient to hold all the bitsselected by B0-B7). In the illustrated embodiment, bit[0] of the maskmay correspond with bits[7:0] of the result packed data operand, bit[1]of the mask may correspond with bits[15:8] of the result packed dataoperand, and so on.

A value of each mask bit may control whether or not the correspondingresult is to be stored in the corresponding sub-lane sized portion ofthe result packed data operand. Each mask bit may either have a firstvalue to allow the result to be stored, or may have a second differentvalue to not allow the result to be stored. According to one possibleconvention, which is shown in the illustration, a mask bit cleared tobinary zero (i.e., 0) may represent a masked-out mask bit for which theresult is not to be stored, whereas a mask bit set to binary one(i.e., 1) may represent an unmasked mask bit for which the result is tobe stored. The opposite convention is also possible. Moreover, any maskvalues desired for the particular implementation may be used byconvention to designate storing or not storing the result. In theillustrated embodiment, bit[4] of the mask is set to binary one(i.e., 1) and therefore unmasked, whereas all of bits[3:0] and [7:5] arecleared to zero (i.e., 0) and therefore masked-out.

The result packed data operand 814 may be generated (e.g., by anexecution unit) and stored in a destination storage location in responseto the masked bit shuffle instruction. In various embodiments, thedestination storage location may be a packed data register, a memorylocation, or other storage location. For this example, only bits[39:32]of the result packed data operand, which correspond to unmasked bit[4]of the mask, may store a result. In some embodiments, the result whosestorage is predicated by the mask elements may be the set of bits of thecorresponding lane of the first source packed data operand (e.g., 64-bitlane 832) selected by the corresponding subset of bit selection elementsof the second source packed data operand (e.g., B0-B7). For example,only bits[39:32] of the result packed data operand may store 8-bits ofQWORD0 selected by B0-B7. In contrast, bits[31:0] and bits[63:40] of theresult packed data operand, which correspond to masked-out bits[3:0] and[7:5] of the mask, may not store this result. Rather, these bits maystore masked-out values. Various fixed or predetermined values may beused for the masked-out values. In some embodiments, zeroing masking mayoptionally be used. In zeroing masking, the masked-out bits of theresult packed data operand may be zeroed-out (e.g., be forced to have avalue of zero). In other embodiments, merging masking may be used. Inmerging masking, the masked-out bits of the result packed data operandmay have a value of a corresponding bit of a source packed data operand(e.g., the first source packed data operand). For example, correspondingbits of the first source packed data operand in the same bit positionsmay be stored in the same bit positions in the result packed dataoperand. One possible advantage of merging masking is that it may beused to combine or assimilate new results with results from priorinstances of the instruction. In some embodiments, if the memory operandcorrespond to the element selects, the mask may also optionally be usedfor memory fault suppression by avoiding touching elements in memorythat are masked off so that associated memory faults are not signaled,although this is not required.

The previously described masking may incorporate both the replicationdescribed for FIG. 7 as well as predication or masking. In this example,only a single mask element is unmasked, although if more than one maskelement were unmasked then replicate copies of the selected bits may bestored in each corresponding sub-lane sized portions of the resultpacked data operand. One possible advantage of such replication and/ormasking is that one of these sets of bits in a desired or efficientposition may be selected for further processing. In other words, thereplication and masking may be used to place the selected set of bits ina desired position within the corresponding lane of the result packeddata operand. This may be used in different ways in differentembodiments. As one specific example, multiple different masked bitshuffle instructions may each be used to shuffle different subsets orportions of the bits of a value. For example, eight instances of themasked bit shuffle instruction may each be used to shuffle a differentset of 8-bits of a 64-bit value. One possible use of the replication andmasking is to effectively move the set of bits selected by theinstruction to an appropriate position in the lane so that they can bemore readily or efficiently merged or combined with the bits selected bythe other instructions. For example, the replication and masking may beused to put one set of 8-bits in bits[7:0] of the lane of the resultpacked data operand, another set of 8-bits in bits[15:8] of the lane ofthe result packed data operand, yet another set of 8-bits in bits[23:16]of the lane of the result packed data operand, and so on. This may helpto increase the speed and/or efficiency of merging these different setsof selected bits to form a full 64-bit bit shuffle result. Other useswill be apparent to those skilled in the art and having the benefit ofthe present disclosure. In other embodiments, instead of masking, animmediate (e.g., an 8-bit immediate imm8) of the instruction may be usedto specify or indicate a position in which to keep a replicated set ofbits, whereas all other positions in the lane may have predeterminedvalues (e.g., zeroes, merged values, etc.). For example, the immediatemay specify a value of three to have the replicated set of bits storedin the third least significant set of replicated bits, will all otherbits in the lane being zeroes.

To further illustrate certain concepts, consider the following detailedexample embodiments for a bit shuffle instruction to store a resultpacked data operand. This instruction is named VPSHUFBITQB and has asoperands a DEST, MSK, SRC1, and SRC2. In some embodiments, theinstruction may allow SRC1 to be a packed data register, SRC2 to beeither a packed data register or a memory location, DEST to be a packeddata register, and MSK to be a source packed data operation maskregister. Table 2 lists opcodes, encodings, and operation descriptionsfor several different embodiments of this instruction.

TABLE 2 VPSHUFBITQB - Shuffle Bits in Packed Quadword Integers - PackedRegister Destination Opcode/Instruction Operation DescriptionVPSHUFBITQB xmm1, {k1} {z}, Using unsigned 6 bit indices from xmm2,xmm3/m128/m64bcst first source, gather bit values from second sourceVPSHUFBITQB ymm1, {k1} {z}, Using unsigned 6 bit indices from ymm2,ymm3/m256/m64bcst first source, gather bit values from second sourceVPSHUFBITQB zmm1, {k1} {z}, Using unsigned 6 bit indices from zmm2,zmm3/m512/m64bcst first source, gather bit values from second source

Xmm, ymm, and zmm respectively represent 128-bit, 256-bit, and 512-bitpacked data registers. The m128/m256/m512 refer respectively to 128-bit,256-bit, and 512-bit memory locations. The m64bcst refers to a 64-bitmemory location on which optional data element broadcast to multipleelements of a vector is to be performed. The {k1} operand specifies asource mask register (e.g., one of mask registers k0-k7) used as asource predicate mask.

The VPSHUFBITQB instruction may be similar to the above-describedVPSHUFBITQMB instruction with a few exceptions noted below. Onedifference is that DEST may be a packed data register (e.g., xmm1, ymm1,or zmm1) instead of a mask register. Another difference is that theinstruction may have an optional source predicate mask operand (e.g.,{MSK}, {k1}), although this is not required. As before, SRC1 may be apacked data register, and SRC2 may be either a packed data register or amemory location.

An example of pseudocode for an embodiment of the VPSHUFBITQBinstruction is shown below. SRC1 represents a first source packed dataoperand, SRC2 represents a second source packed data operand, and DESTrepresents a destination. The k1 operand represents a source packed dataoperation mask register used for predication. In the pseudocode, KLrepresents a mask length and/or the number of data element positionswithin a packed data operand, VL represents a length of the vectors orpacked data operands, “i” represents a position counter to select aquadword or lane to be used for the iteration, and “j” represents aposition counter to select a byte within the lane. EVEX.b==1 configuresembedded broadcast when SRC2 *is memory*. The parameter “M” representsthe bit position within the appropriate quadword of SRC2 indicated bythe appropriate byte of SRC1. Other embodiments may implement theinstructions using different sets of microarchitectural operations. Inthis pseudocode, either zeroing style masking “*zeroing*” or mergingstyle masking “*remains unchanged*” may be used. Replication of the8-bits selected throughout all corresponding 64-bits of the result mayoptionally be used.

VPSHUFBITQB DEST, SRC1, SRC2   (KL, VL) = (16, 128), (32, 256), (64,512) FOR i ← 0 TO KL/8 − 1 ; Qword  BYTE_TEMP ← 0  FOR j ← 0 TO 7 ; Byte  IF EVEX.b AND SRC2 *is memory*   THEN    DATA[63:0] ← SRC2.qword[0];  ELSE    DATA[63:0] ← SRC2.qword[i];   ENDIF    M ←SRC1.qword[i].byte[j] & 0x3F;   BIT ← DATA[M]   BYTE_TEMP[j] ← BIT ENDFOR;  FOR j ← 0 TO 7   IF K1[i*8+j]   THEN    DEST.qword[i].byte[j]← BYTE_TEMP;   ELSIF *zeroing*    DEST.qword[i].byte[j] ← 0;   ELSE   DEST.qword[i].byte[j] *remains unchanged *   ENDIF;  ENDFOR; ENDFOR;DEST[MAX_VL-1:VL] ← 0;

It is to be appreciated that these are just a few example embodiments ofsuitable instructions. Other embodiments may use either narrower (e.g.,64-bit) or wider (e.g., 1024-bit) or just differently sized packed dataoperands. Still other embodiments may use different sized lanes besidesquadword-sized lanes (e.g., 16-bit or 32-bit lanes) and/or differentsized indexes (e.g., 4-bit nibble indexes, 5-bit indexes, etc.). Inalternate embodiments, other storage locations (e.g. memory locations)may be used for operands. Other embodiments may optionally omitmasking/predication. Other embodiments may optionally omit data elementbroadcast.

FIG. 9 is a block diagram of an embodiment of a bit shuffle instruction902. The instruction includes an operation code or opcode 984. Theopcode may represent a plurality of bits or one or more fields that areoperable to identify the instruction and/or the operation to beperformed (e.g., a bit shuffle operation).

The instruction also includes a first source operand specifier 985 toexplicitly specify a register, memory location, or other storagelocation used to store a first source operand, a second source operandspecifier 986 to explicitly specify a register or other storage locationused to store a second source operand, and a destination operandspecifier 987 to explicitly specify a register or other storage locationwhere a result operand is to be stored. By way of example, each of thesespecifiers may include a set of bits or one or more fields to explicitlyspecify an address of a register, memory location, or other storagelocation. Alternatively, one or more implicit storage locations (e.g.,implicit to an opcode of the instruction) may optionally be used for oneor more of these operands. For example, it may be implicit to an opcodeof the instruction to use a given fixed register for an operand. Asanother example, it may be implicit to reuse a register initially for asource operand and then for the result operand (e.g., an implicitsource/destination register).

In some embodiments, the instruction may include an optional packed dataoperation mask specifier 988 to explicitly specify a packed dataoperation mask or storage location (e.g., a mask register).Alternatively, the packed data operation mask may be implicitlyindicated. In some embodiments, the instruction format may also includean optional type of masking operation specifier 989 to specify a type ofmasking operation. By way of example, the type of masking operationspecifier may include a single bit to specify whether merging-masking orzeroing-masking is to be performed. Masking is optional not required.

In some embodiments, in which the instruction is to use data elementbroadcast, the instruction may optionally include a data elementbroadcast control 990. The data element broadcast control may includeone or more bits or fields to indicate that data element broadcast is tobe performed to broadcast a single source data element accessed from astorage location (e.g., a memory location) to a plurality of source dataelements (e.g., in a temporary register) that are to be used by the bitshuffle operation. Alternatively, data element broadcast may be implicitto the instruction (e.g., implicit to the opcode) instead of beingexplicitly specified. As mentioned above, data element broadcast isoptional and not required.

This is just one example of a suitable bit shuffle instruction.Alternate embodiments may include a subset of the illustratedfields/specifiers, may add additional fields/specifiers, may overlapcertain fields/specifiers, etc. In addition, the illustrated order andarrangement of the fields/specifiers is not required. Thefields/specifiers may be rearranged variously. In addition,fields/specifiers need not include contiguous sequences of bits, butrather may include non-contiguous or separated bits. In someembodiments, the instruction format may have a VEX or EVEX encoding orinstruction format, although the scope of the invention is not solimited.

FIG. 10 is a block diagram of an example embodiment of a suitable set ofpacked data registers 1008. The packed data registers include thirty-two512-bit packed data registers labeled ZMM0 through ZMM31. In theillustrated embodiment, the lower order 256-bits of the lower sixteenregisters, namely ZMM0-ZMM15, are aliased or overlaid on respective256-bit packed data registers labeled YMM0-YMM15, although this is notrequired. Likewise, in the illustrated embodiment, the lower order128-bits of the registers YMM0-YMM15 are aliased or overlaid onrespective 128-bit packed data registers labeled XMM0-XMM15, althoughthis also is not required. The 512-bit registers ZMM0 through ZMM31 areoperable to hold 512-bit packed data, 256-bit packed data, or 128-bitpacked data. The 256-bit registers YMM0-YMM15 are operable to hold256-bit packed data or 128-bit packed data. The 128-bit registersXMM0-XMM15 are operable to hold 128-bit packed data. In someembodiments, each of the registers may be used to store either packedfloating-point data or packed integer data. Different data element sizesare supported including at least 8-bit byte data, 16-bit word data,32-bit doubleword, 32-bit single-precision floating point data, 64-bitquadword, and 64-bit double-precision floating point data. In alternateembodiments, different numbers of registers and/or different sizes ofregisters may be used. In still other embodiments, registers may or maynot use aliasing of larger registers on smaller registers and/or may ormay not be used to store floating point data.

FIG. 11 is a block diagram of an example embodiment of a suitable set ofpacked data operation mask registers 1116. In the illustratedembodiment, the set includes eight registers labeled k0 through k7.Alternate embodiments may include either fewer than eight registers(e.g., two, four, six, etc.), or more than eight registers (e.g.,sixteen, thirty-two, etc.). Each of these registers may be used to storea packed data operation mask. In the illustrated embodiment, each of theregisters is 64-bits. In alternate embodiments, the widths of theregisters may be either wider than 64-bits (e.g., 80-bits, 128-bits,etc.), or narrower than 64-bits (e.g., 8-bits, 16-bits, 32-bits, etc.).The registers may be implemented in different ways using well knowntechniques and are not limited to any known particular type of circuit.Examples of suitable registers include, but are not limited to,dedicated physical registers, dynamically allocated physical registersusing register renaming, and combinations thereof.

In some embodiments, the packed data operation mask registers 1016 maybe a separate, dedicated set of architectural registers. In someembodiments, the instructions may encode or specify the packed dataoperation mask registers in different bits or one or more differentfields of an instruction format than those used to encode or specifyother types of registers (e.g., packed data registers). By way ofexample, an instruction may use three bits (e.g., a 3-bit field) toencode or specify any one of the eight packed data operation maskregisters k0 through k7. In one particular implementation, only packeddata operation mask registers k1 through k7 (but not k0) may beaddressed as a predicate operand to predicate a masked packed dataoperation. The register k0 may be used as a regular source ordestination, but may not be encoded as a predicate operand (e.g., if k0is specified it has a “no mask” encoding), although this is notrequired.

FIG. 12 illustrates a packed data operation mask register 1216 (e.g.,one of the mask registers 1016) and the number of mask bits used fordifferent sized packed data operands. In one aspect, these bits may beused for predication. In another aspect, these bits may be used to storeresult bits. The illustrated examples consider 8-bit data elements(e.g., 8-bit byte sized bit selection elements). As shown, the sixteenleast significant bits may be used for 128-bit packed data with 8-bitdata elements, the thirty-two least significant bits may be used for256-bit packed data with 8-bit data elements, or all sixty-four bits maybe used for 512-bit packed data with 8-bit data elements. Twice as manymask bits may be used if 4-bit nibble bit selection elements are usedand two nibbles are contained in a given byte of the packed dataoperand.

An instruction set includes one or more instruction formats. A giveninstruction format defines various fields (number of bits, location ofbits) to specify, among other things, the operation to be performed(opcode) and the operand(s) on which that operation is to be performed.Some instruction formats are further broken down though the definitionof instruction templates (or subformats). For example, the instructiontemplates of a given instruction format may be defined to have differentsubsets of the instruction format's fields (the included fields aretypically in the same order, but at least some have different bitpositions because there are less fields included) and/or defined to havea given field interpreted differently. Thus, each instruction of an ISAis expressed using a given instruction format (and, if defined, in agiven one of the instruction templates of that instruction format) andincludes fields for specifying the operation and the operands. Forexample, an exemplary ADD instruction has a specific opcode and aninstruction format that includes an opcode field to specify that opcodeand operand fields to select operands (source1/destination and source2);and an occurrence of this ADD instruction in an instruction stream willhave specific contents in the operand fields that select specificoperands. A set of SIMD extensions referred to the Advanced VectorExtensions (AVX) (AVX1 and AVX2) and using the Vector Extensions (VEX)coding scheme, has been, has been released and/or published (e.g., seeIntel® 64 and IA-32 Architectures Software Developers Manual, October2011; and see Intel® Advanced Vector Extensions Programming Reference,June 2011).

Exemplary Instruction Formats

Embodiments of the instruction(s) described herein may be embodied indifferent formats. Additionally, exemplary systems, architectures, andpipelines are detailed below. Embodiments of the instruction(s) may beexecuted on such systems, architectures, and pipelines, but are notlimited to those detailed.

VEX Instruction Format

VEX encoding allows instructions to have more than two operands, andallows SIMD vector registers to be longer than 128 bits. The use of aVEX prefix provides for three-operand (or more) syntax. For example,previous two-operand instructions performed operations such as A=A+B,which overwrites a source operand. The use of a VEX prefix enablesoperands to perform nondestructive operations such as A=B+C.

FIG. 13A illustrates an exemplary AVX instruction format including a VEXprefix 1302, real opcode field 1330, Mod R/M byte 1340, SIB byte 1350,displacement field 1362, and IMM8 1372. FIG. 13B illustrates whichfields from FIG. 13A make up a full opcode field 1374 and a baseoperation field 1342. FIG. 13C illustrates which fields from FIG. 13Amake up a register index field 1344.

VEX Prefix (Bytes 0-2) 1302 is encoded in a three-byte form. The firstbyte is the Format Field 1340 (VEX Byte 0, bits[7:0]), which contains anexplicit C4 byte value (the unique value used for distinguishing the C4instruction format). The second-third bytes (VEX Bytes 1-2) include anumber of bit fields providing specific capability. Specifically, REXfield 1305 (VEX Byte 1, bits[7-5]) consists of a VEX.R bit field (VEXByte 1, bit [7]-R), VEX.X bit field (VEX byte 1, bit [6]-X), and VEX.Bbit field (VEX byte 1, bit[5]-B). Other fields of the instructionsencode the lower three bits of the register indexes as is known in theart (rrr, xxx, and bbb), so that Rrrr, Xxxx, and Bbbb may be formed byadding VEX.R, VEX.X, and VEX.B. Opcode map field 1315 (VEX byte 1,bits[4:0]-mmmmm) includes content to encode an implied leading opcodebyte. W Field 1364 (VEX byte 2, bit [7]-W)—is represented by thenotation VEX.W, and provides different functions depending on theinstruction. The role of VEX.vvvv 1320 (VEX Byte 2, bits[6:3]-vvvv) mayinclude the following: 1) VEX.vvvv encodes the first source registeroperand, specified in inverted (1s complement) form and is valid forinstructions with 2 or more source operands; 2) VEX.vvvv encodes thedestination register operand, specified in 1 s complement form forcertain vector shifts; or 3) VEX.vvvv does not encode any operand, thefield is reserved and should contain 1111b. If VEX.L 1368 Size field(VEX byte 2, bit [2]-L)=0, it indicates 128 bit vector; if VEX.L=1, itindicates 256 bit vector. Prefix encoding field 1325 (VEX byte 2,bits[1:0]-pp) provides additional bits for the base operation field.

Real Opcode Field 1330 (Byte 3) is also known as the opcode byte. Partof the opcode is specified in this field.

MOD R/M Field 1340 (Byte 4) includes MOD field 1342 (bits[7-6]), Regfield 1344 (bits[5-3]), and R/M field 1346 (bits[2-0]). The role of Regfield 1344 may include the following: encoding either the destinationregister operand or a source register operand (the rrr of Rrrr), or betreated as an opcode extension and not used to encode any instructionoperand. The role of R/M field 1346 may include the following: encodingthe instruction operand that references a memory address, or encodingeither the destination register operand or a source register operand.

Scale, Index, Base (SIB)—The content of Scale field 1350 (Byte 5)includes SS1352 (bits[7-6]), which is used for memory addressgeneration. The contents of SIB.xxx 1354 (bits[5-3]) and SIB.bbb 1356(bits[2-0]) have been previously referred to with regard to the registerindexes Xxxx and Bbbb.

The Displacement Field 1362 and the immediate field (IMM8) 1372 containaddress data.

Generic Vector Friendly Instruction Format

A vector friendly instruction format is an instruction format that issuited for vector instructions (e.g., there are certain fields specificto vector operations). While embodiments are described in which bothvector and scalar operations are supported through the vector friendlyinstruction format, alternative embodiments use only vector operationsthe vector friendly instruction format.

FIGS. 14A-14B are block diagrams illustrating a generic vector friendlyinstruction format and instruction templates thereof according toembodiments of the invention. FIG. 14A is a block diagram illustrating ageneric vector friendly instruction format and class A instructiontemplates thereof according to embodiments of the invention; while FIG.14B is a block diagram illustrating the generic vector friendlyinstruction format and class B instruction templates thereof accordingto embodiments of the invention. Specifically, a generic vector friendlyinstruction format 1400 for which are defined class A and class Binstruction templates, both of which include no memory access 1405instruction templates and memory access 1420 instruction templates. Theterm generic in the context of the vector friendly instruction formatrefers to the instruction format not being tied to any specificinstruction set.

While embodiments of the invention will be described in which the vectorfriendly instruction format supports the following: a 64 byte vectoroperand length (or size) with 32 bit (4 byte) or 64 bit (8 byte) dataelement widths (or sizes) (and thus, a 64 byte vector consists of either16 doubleword-size elements or alternatively, 8 quadword-size elements);a 64 byte vector operand length (or size) with 16 bit (2 byte) or 8 bit(1 byte) data element widths (or sizes); a 32 byte vector operand length(or size) with 32 bit (4 byte), 64 bit (8 byte), 16 bit (2 byte), or 8bit (1 byte) data element widths (or sizes); and a 16 byte vectoroperand length (or size) with 32 bit (4 byte), 64 bit (8 byte), 16 bit(2 byte), or 8 bit (1 byte) data element widths (or sizes); alternativeembodiments may support more, less and/or different vector operand sizes(e.g., 256 byte vector operands) with more, less, or different dataelement widths (e.g., 128 bit (16 byte) data element widths).

The class A instruction templates in FIG. 14A include: 1) within the nomemory access 1405 instruction templates there is shown a no memoryaccess, full round control type operation 1410 instruction template anda no memory access, data transform type operation 1415 instructiontemplate; and 2) within the memory access 1420 instruction templatesthere is shown a memory access, temporal 1425 instruction template and amemory access, non-temporal 1430 instruction template. The class Binstruction templates in FIG. 14B include: 1) within the no memoryaccess 1405 instruction templates there is shown a no memory access,write mask control, partial round control type operation 1412instruction template and a no memory access, write mask control, vsizetype operation 1417 instruction template; and 2) within the memoryaccess 1420 instruction templates there is shown a memory access, writemask control 1427 instruction template.

The generic vector friendly instruction format 1400 includes thefollowing fields listed below in the order illustrated in FIGS. 14A-14B.

Format field 1440—a specific value (an instruction format identifiervalue) in this field uniquely identifies the vector friendly instructionformat, and thus occurrences of instructions in the vector friendlyinstruction format in instruction streams. As such, this field isoptional in the sense that it is not needed for an instruction set thathas only the generic vector friendly instruction format.

Base operation field 1442—its content distinguishes different baseoperations.

Register index field 1444—its content, directly or through addressgeneration, specifies the locations of the source and destinationoperands, be they in registers or in memory. These include a sufficientnumber of bits to select N registers from a P×Q (e.g. 32×512, 16×128,32×1024, 64×1024) register file. While in one embodiment N may be up tothree sources and one destination register, alternative embodiments maysupport more or less sources and destination registers (e.g., maysupport up to two sources where one of these sources also acts as thedestination, may support up to three sources where one of these sourcesalso acts as the destination, may support up to two sources and onedestination).

Modifier field 1446—its content distinguishes occurrences ofinstructions in the generic vector instruction format that specifymemory access from those that do not; that is, between no memory access1405 instruction templates and memory access 1420 instruction templates.Memory access operations read and/or write to the memory hierarchy (insome cases specifying the source and/or destination addresses usingvalues in registers), while non-memory access operations do not (e.g.,the source and destinations are registers). While in one embodiment thisfield also selects between three different ways to perform memoryaddress calculations, alternative embodiments may support more, less, ordifferent ways to perform memory address calculations.

Augmentation operation field 1450—its content distinguishes which one ofa variety of different operations to be performed in addition to thebase operation. This field is context specific. In one embodiment of theinvention, this field is divided into a class field 1468, an alpha field1452, and a beta field 1454. The augmentation operation field 1450allows common groups of operations to be performed in a singleinstruction rather than 2, 3, or 4 instructions.

Scale field 1460—its content allows for the scaling of the index field'scontent for memory address generation (e.g., for address generation thatuses 2^(scale)*index+base).

Displacement Field 1462A—its content is used as part of memory addressgeneration (e.g., for address generation that uses2^(scale)*index+base+displacement).

Displacement Factor Field 1462B (note that the juxtaposition ofdisplacement field 1462A directly over displacement factor field 1462Bindicates one or the other is used)—its content is used as part ofaddress generation; it specifies a displacement factor that is to bescaled by the size of a memory access (N)—where N is the number of bytesin the memory access (e.g., for address generation that uses2^(scale)*index+base+scaled displacement). Redundant low-order bits areignored and hence, the displacement factor field's content is multipliedby the memory operands total size (N) in order to generate the finaldisplacement to be used in calculating an effective address. The valueof N is determined by the processor hardware at runtime based on thefull opcode field 1474 (described later herein) and the datamanipulation field 1454C. The displacement field 1462A and thedisplacement factor field 1462B are optional in the sense that they arenot used for the no memory access 1405 instruction templates and/ordifferent embodiments may implement only one or none of the two.

Data element width field 1464—its content distinguishes which one of anumber of data element widths is to be used (in some embodiments for allinstructions; in other embodiments for only some of the instructions).This field is optional in the sense that it is not needed if only onedata element width is supported and/or data element widths are supportedusing some aspect of the opcodes.

Write mask field 1470—its content controls, on a per data elementposition basis, whether that data element position in the destinationvector operand reflects the result of the base operation andaugmentation operation. Class A instruction templates supportmerging-writemasking, while class B instruction templates support bothmerging- and zeroing-writemasking. When merging, vector masks allow anyset of elements in the destination to be protected from updates duringthe execution of any operation (specified by the base operation and theaugmentation operation); in other one embodiment, preserving the oldvalue of each element of the destination where the corresponding maskbit has a 0. In contrast, when zeroing vector masks allow any set ofelements in the destination to be zeroed during the execution of anyoperation (specified by the base operation and the augmentationoperation); in one embodiment, an element of the destination is set to 0when the corresponding mask bit has a 0 value. A subset of thisfunctionality is the ability to control the vector length of theoperation being performed (that is, the span of elements being modified,from the first to the last one); however, it is not necessary that theelements that are modified be consecutive. Thus, the write mask field1470 allows for partial vector operations, including loads, stores,arithmetic, logical, etc. While embodiments of the invention aredescribed in which the write mask field's 1470 content selects one of anumber of write mask registers that contains the write mask to be used(and thus the write mask field's 1470 content indirectly identifies thatmasking to be performed), alternative embodiments instead or additionalallow the mask write field's 1470 content to directly specify themasking to be performed.

Immediate field 1472—its content allows for the specification of animmediate. This field is optional in the sense that is it not present inan implementation of the generic vector friendly format that does notsupport immediate and it is not present in instructions that do not usean immediate.

Class field 1468—its content distinguishes between different classes ofinstructions. With reference to FIGS. 14A-B, the contents of this fieldselect between class A and class B instructions. In FIGS. 14A-B, roundedcorner squares are used to indicate a specific value is present in afield (e.g., class A 1468A and class B 1468B for the class field 1468respectively in FIGS. 14A-B).

Instruction Templates of Class A

In the case of the non-memory access 1405 instruction templates of classA, the alpha field 1452 is interpreted as an RS field 1452A, whosecontent distinguishes which one of the different augmentation operationtypes are to be performed (e.g., round 1452A.1 and data transform1452A.2 are respectively specified for the no memory access, round typeoperation 1410 and the no memory access, data transform type operation1415 instruction templates), while the beta field 1454 distinguisheswhich of the operations of the specified type is to be performed. In theno memory access 1405 instruction templates, the scale field 1460, thedisplacement field 1462A, and the displacement scale filed 1462B are notpresent.

No-Memory Access Instruction Templates—Full Round Control Type OperationIn the no memory access full round control type operation 1410instruction template, the beta field 1454 is interpreted as a roundcontrol field 1454A, whose content(s) provide static rounding. While inthe described embodiments of the invention the round control field 1454Aincludes a suppress all floating point exceptions (SAE) field 1456 and around operation control field 1458, alternative embodiments may supportmay encode both these concepts into the same field or only have one orthe other of these concepts/fields (e.g., may have only the roundoperation control field 1458).

SAE field 1456—its content distinguishes whether or not to disable theexception event reporting; when the SAE field's 1456 content indicatessuppression is enabled, a given instruction does not report any kind offloating-point exception flag and does not raise any floating pointexception handler.

Round operation control field 1458—its content distinguishes which oneof a group of rounding operations to perform (e.g., Round-up,Round-down, Round-towards-zero and Round-to-nearest). Thus, the roundoperation control field 1458 allows for the changing of the roundingmode on a per instruction basis. In one embodiment of the inventionwhere a processor includes a control register for specifying roundingmodes, the round operation control field's 1450 content overrides thatregister value.

No Memory Access Instruction Templates—Data Transform Type Operation

In the no memory access data transform type operation 1415 instructiontemplate, the beta field 1454 is interpreted as a data transform field1454B, whose content distinguishes which one of a number of datatransforms is to be performed (e.g., no data transform, swizzle,broadcast).

In the case of a memory access 1420 instruction template of class A, thealpha field 1452 is interpreted as an eviction hint field 1452B, whosecontent distinguishes which one of the eviction hints is to be used (inFIG. 14A, temporal 1452B.1 and non-temporal 1452B.2 are respectivelyspecified for the memory access, temporal 1425 instruction template andthe memory access, non-temporal 1430 instruction template), while thebeta field 1454 is interpreted as a data manipulation field 1454C, whosecontent distinguishes which one of a number of data manipulationoperations (also known as primitives) is to be performed (e.g., nomanipulation; broadcast; up conversion of a source; and down conversionof a destination). The memory access 1420 instruction templates includethe scale field 1460, and optionally the displacement field 1462A or thedisplacement scale field 1462B.

Vector memory instructions perform vector loads from and vector storesto memory, with conversion support. As with regular vector instructions,vector memory instructions transfer data from/to memory in a dataelement-wise fashion, with the elements that are actually transferred isdictated by the contents of the vector mask that is selected as thewrite mask.

Memory Access Instruction Templates—Temporal

Temporal data is data likely to be reused soon enough to benefit fromcaching. This is, however, a hint, and different processors mayimplement it in different ways, including ignoring the hint entirely.

Memory Access Instruction Templates—Non-Temporal

Non-temporal data is data unlikely to be reused soon enough to benefitfrom caching in the 1st-level cache and should be given priority foreviction. This is, however, a hint, and different processors mayimplement it in different ways, including ignoring the hint entirely.

Instruction Templates of Class B

In the case of the instruction templates of class B, the alpha field1452 is interpreted as a write mask control (Z) field 1452C, whosecontent distinguishes whether the write masking controlled by the writemask field 1470 should be a merging or a zeroing.

In the case of the non-memory access 1405 instruction templates of classB, part of the beta field 1454 is interpreted as an RL field 1457A,whose content distinguishes which one of the different augmentationoperation types are to be performed (e.g., round 1457A.1 and vectorlength (VSIZE) 1457A.2 are respectively specified for the no memoryaccess, write mask control, partial round control type operation 1412instruction template and the no memory access, write mask control, VSIZEtype operation 1417 instruction template), while the rest of the betafield 1454 distinguishes which of the operations of the specified typeis to be performed. In the no memory access 1405 instruction templates,the scale field 1460, the displacement field 1462A, and the displacementscale filed 1462B are not present.

In the no memory access, write mask control, partial round control typeoperation 1410 instruction template, the rest of the beta field 1454 isinterpreted as a round operation field 1459A and exception eventreporting is disabled (a given instruction does not report any kind offloating-point exception flag and does not raise any floating pointexception handler).

Round operation control field 1459A—just as round operation controlfield 1458, its content distinguishes which one of a group of roundingoperations to perform (e.g., Round-up, Round-down, Round-towards-zeroand Round-to-nearest). Thus, the round operation control field 1459Aallows for the changing of the rounding mode on a per instruction basis.In one embodiment of the invention where a processor includes a controlregister for specifying rounding modes, the round operation controlfield's 1450 content overrides that register value.

In the no memory access, write mask control, VSIZE type operation 1417instruction template, the rest of the beta field 1454 is interpreted asa vector length field 1459B, whose content distinguishes which one of anumber of data vector lengths is to be performed on (e.g., 128, 256, or512 byte).

In the case of a memory access 1420 instruction template of class B,part of the beta field 1454 is interpreted as a broadcast field 1457B,whose content distinguishes whether or not the broadcast type datamanipulation operation is to be performed, while the rest of the betafield 1454 is interpreted the vector length field 1459B. The memoryaccess 1420 instruction templates include the scale field 1460, andoptionally the displacement field 1462A or the displacement scale field1462B.

With regard to the generic vector friendly instruction format 1400, afull opcode field 1474 is shown including the format field 1440, thebase operation field 1442, and the data element width field 1464. Whileone embodiment is shown where the full opcode field 1474 includes all ofthese fields, the full opcode field 1474 includes less than all of thesefields in embodiments that do not support all of them. The full opcodefield 1474 provides the operation code (opcode).

The augmentation operation field 1450, the data element width field1464, and the write mask field 1470 allow these features to be specifiedon a per instruction basis in the generic vector friendly instructionformat.

The combination of write mask field and data element width field createtyped instructions in that they allow the mask to be applied based ondifferent data element widths.

The various instruction templates found within class A and class B arebeneficial in different situations. In some embodiments of theinvention, different processors or different cores within a processormay support only class A, only class B, or both classes. For instance, ahigh performance general purpose out-of-order core intended forgeneral-purpose computing may support only class B, a core intendedprimarily for graphics and/or scientific (throughput) computing maysupport only class A, and a core intended for both may support both (ofcourse, a core that has some mix of templates and instructions from bothclasses but not all templates and instructions from both classes iswithin the purview of the invention). Also, a single processor mayinclude multiple cores, all of which support the same class or in whichdifferent cores support different class. For instance, in a processorwith separate graphics and general purpose cores, one of the graphicscores intended primarily for graphics and/or scientific computing maysupport only class A, while one or more of the general purpose cores maybe high performance general purpose cores with out of order executionand register renaming intended for general-purpose computing thatsupport only class B. Another processor that does not have a separategraphics core, may include one more general purpose in-order orout-of-order cores that support both class A and class B. Of course,features from one class may also be implement in the other class indifferent embodiments of the invention. Programs written in a high levellanguage would be put (e.g., just in time compiled or staticallycompiled) into an variety of different executable forms, including: 1) aform having only instructions of the class(es) supported by the targetprocessor for execution; or 2) a form having alternative routineswritten using different combinations of the instructions of all classesand having control flow code that selects the routines to execute basedon the instructions supported by the processor which is currentlyexecuting the code.

Exemplary Specific Vector Friendly Instruction Format

FIG. 15 is a block diagram illustrating an exemplary specific vectorfriendly instruction format according to embodiments of the invention.FIG. 15 shows a specific vector friendly instruction format 1500 that isspecific in the sense that it specifies the location, size,interpretation, and order of the fields, as well as values for some ofthose fields. The specific vector friendly instruction format 1500 maybe used to extend the x86 instruction set, and thus some of the fieldsare similar or the same as those used in the existing x86 instructionset and extension thereof (e.g., AVX). This format remains consistentwith the prefix encoding field, real opcode byte field, MOD R/M field,SIB field, displacement field, and immediate fields of the existing x86instruction set with extensions. The fields from FIG. 14 into which thefields from FIG. 15 map are illustrated.

It should be understood that, although embodiments of the invention aredescribed with reference to the specific vector friendly instructionformat 1500 in the context of the generic vector friendly instructionformat 1400 for illustrative purposes, the invention is not limited tothe specific vector friendly instruction format 1500 except whereclaimed. For example, the generic vector friendly instruction format1400 contemplates a variety of possible sizes for the various fields,while the specific vector friendly instruction format 1500 is shown ashaving fields of specific sizes. By way of specific example, while thedata element width field 1464 is illustrated as a one bit field in thespecific vector friendly instruction format 1500, the invention is notso limited (that is, the generic vector friendly instruction format 1400contemplates other sizes of the data element width field 1464).

The generic vector friendly instruction format 1400 includes thefollowing fields listed below in the order illustrated in FIG. 15A.

EVEX Prefix (Bytes 0-3) 1502—is encoded in a four-byte form.

Format Field 1440 (EVEX Byte 0, bits[7:0])—the first byte (EVEX Byte 0)is the format field 1440 and it contains 0x62 (the unique value used fordistinguishing the vector friendly instruction format in one embodimentof the invention).

The second-fourth bytes (EVEX Bytes 1-3) include a number of bit fieldsproviding specific capability.

REX field 1505 (EVEX Byte 1, bits[7-5])—consists of a EVEX.R bit field(EVEX Byte 1, bit [7]-R), EVEX.X bit field (EVEX byte 1, bit [6]-X), and1457BEX byte 1, bit[5]-B). The EVEX.R, EVEX.X, and EVEX.B bit fieldsprovide the same functionality as the corresponding VEX bit fields, andare encoded using 1s complement form, i.e. ZMM0 is encoded as 1111B,ZMM15 is encoded as 0000B. Other fields of the instructions encode thelower three bits of the register indexes as is known in the art (rrr,xxx, and bbb), so that Rrrr, Xxxx, and Bbbb may be formed by addingEVEX.R, EVEX.X, and EVEX.B.

REX′ field 1410—this is the first part of the REX′ field 1410 and is theEVEX.R′ bit field (EVEX Byte 1, bit [4]-R′) that is used to encodeeither the upper 16 or lower 16 of the extended 32 register set. In oneembodiment of the invention, this bit, along with others as indicatedbelow, is stored in bit inverted format to distinguish (in thewell-known x86 32-bit mode) from the BOUND instruction, whose realopcode byte is 62, but does not accept in the MOD R/M field (describedbelow) the value of 11 in the MOD field; alternative embodiments of theinvention do not store this and the other indicated bits below in theinverted format. A value of 1 is used to encode the lower 16 registers.In other words, R′Rrrr is formed by combining EVEX.R′, EVEX.R, and theother RRR from other fields.

Opcode map field 1515 (EVEX byte 1, bits[3:0]-mmmm)—its content encodesan implied leading opcode byte (0F, 0F 38, or 0F 3).

Data element width field 1464 (EVEX byte 2, bit [7]-W)—is represented bythe notation EVEX.W. EVEX.W is used to define the granularity (size) ofthe datatype (either 32-bit data elements or 64-bit data elements).

EVEX.vvvv 1520 (EVEX Byte 2, bits[6:3]-vvvv)—the role of EVEX.vvvv mayinclude the following: 1) EVEX.vvvv encodes the first source registeroperand, specified in inverted (1s complement) form and is valid forinstructions with 2 or more source operands; 2) EVEX.vvvv encodes thedestination register operand, specified in is complement form forcertain vector shifts; or 3) EVEX.vvvv does not encode any operand, thefield is reserved and should contain 1111b. Thus, EVEX.vvvv field 1520encodes the 4 low-order bits of the first source register specifierstored in inverted (1s complement) form. Depending on the instruction,an extra different EVEX bit field is used to extend the specifier sizeto 32 registers.

EVEX.U 1468 Class field (EVEX byte 2, bit [2]-U)—If EVEX.U=0, itindicates class A or EVEX.U0; if EVEX.U=1, it indicates class B orEVEX.U1.

Prefix encoding field 1525 (EVEX byte 2, bits[1:0]-pp)—providesadditional bits for the base operation field. In addition to providingsupport for the legacy SSE instructions in the EVEX prefix format, thisalso has the benefit of compacting the SIMD prefix (rather thanrequiring a byte to express the SIMD prefix, the EVEX prefix requiresonly 2 bits). In one embodiment, to support legacy SSE instructions thatuse a SIMD prefix (66H, F2H, F3H) in both the legacy format and in theEVEX prefix format, these legacy SIMD prefixes are encoded into the SIMDprefix encoding field; and at runtime are expanded into the legacy SIMDprefix prior to being provided to the decoder's PLA (so the PLA canexecute both the legacy and EVEX format of these legacy instructionswithout modification). Although newer instructions could use the EVEXprefix encoding field's content directly as an opcode extension, certainembodiments expand in a similar fashion for consistency but allow fordifferent meanings to be specified by these legacy SIMD prefixes. Analternative embodiment may redesign the PLA to support the 2 bit SIMDprefix encodings, and thus not require the expansion.

Alpha field 1452 (EVEX byte 3, bit [7]-EH; also known as EVEX.EH,EVEX.rs, EVEX.RL, EVEX.write mask control, and EVEX.N; also illustratedwith a)—as previously described, this field is context specific.

Beta field 1454 (EVEX byte 3, bits[6:4]-SSS, also known as EVEX.s₂₋₀,EVEX.r₂₋₀, EVEX.rr1, EVEX.LL0, EVEX.LLB; also illustrated with βββ)—aspreviously described, this field is context specific.

REX′ field 1410—this is the remainder of the REX′ field and is theEVEX.V′ bit field (EVEX Byte 3, bit [3]-V′) that may be used to encodeeither the upper 16 or lower 16 of the extended 32 register set. Thisbit is stored in bit inverted format. A value of 1 is used to encode thelower 16 registers. In other words, V′ VVVV is formed by combiningEVEX.V′, EVEX.vvvv.

Write mask field 1470 (EVEX byte 3, bits[2:0]-kkk)—its content specifiesthe index of a register in the write mask registers as previouslydescribed. In one embodiment of the invention, the specific valueEVEX.kkk=000 has a special behavior implying no write mask is used forthe particular instruction (this may be implemented in a variety of waysincluding the use of a write mask hardwired to all ones or hardware thatbypasses the masking hardware).

Real Opcode Field 1530 (Byte 4) is also known as the opcode byte. Partof the opcode is specified in this field.

MOD R/M Field 1540 (Byte 5) includes MOD field 1542, Reg field 1544, andR/M field 1546. As previously described, the MOD field's 1542 contentdistinguishes between memory access and non-memory access operations.The role of Reg field 1544 can be summarized to two situations: encodingeither the destination register operand or a source register operand, orbe treated as an opcode extension and not used to encode any instructionoperand. The role of R/M field 1546 may include the following: encodingthe instruction operand that references a memory address, or encodingeither the destination register operand or a source register operand.

Scale, Index, Base (SIB) Byte (Byte 6)—As previously described, thescale field's 1450 content is used for memory address generation.SIB.xxx 1554 and SIB.bbb 1556—the contents of these fields have beenpreviously referred to with regard to the register indexes Xxxx andBbbb.

Displacement field 1462A (Bytes 7-10)—when MOD field 1542 contains 10,bytes 7-10 are the displacement field 1462A, and it works the same asthe legacy 32-bit displacement (disp32) and works at byte granularity.

Displacement factor field 1462B (Byte 7)—when MOD field 1542 contains01, byte 7 is the displacement factor field 1462B. The location of thisfield is that same as that of the legacy x86 instruction set 8-bitdisplacement (disp8), which works at byte granularity. Since disp8 issign extended, it can only address between −128 and 127 bytes offsets;in terms of 64 byte cache lines, disp8 uses 8 bits that can be set toonly four really useful values −128, −64, 0, and 64; since a greaterrange is often needed, disp32 is used; however, disp32 requires 4 bytes.In contrast to disp8 and disp32, the displacement factor field 1462B isa reinterpretation of disp8; when using displacement factor field 1462B,the actual displacement is determined by the content of the displacementfactor field multiplied by the size of the memory operand access (N).This type of displacement is referred to as disp8*N. This reduces theaverage instruction length (a single byte of used for the displacementbut with a much greater range). Such compressed displacement is based onthe assumption that the effective displacement is multiple of thegranularity of the memory access, and hence, the redundant low-orderbits of the address offset do not need to be encoded. In other words,the displacement factor field 1462B substitutes the legacy x86instruction set 8-bit displacement. Thus, the displacement factor field1462B is encoded the same way as an x86 instruction set 8-bitdisplacement (so no changes in the ModRM/SIB encoding rules) with theonly exception that disp8 is overloaded to disp8*N. In other words,there are no changes in the encoding rules or encoding lengths but onlyin the interpretation of the displacement value by hardware (which needsto scale the displacement by the size of the memory operand to obtain abyte-wise address offset).

Immediate field 1472 operates as previously described.

Full Opcode Field

FIG. 15B is a block diagram illustrating the fields of the specificvector friendly instruction format 1500 that make up the full opcodefield 1474 according to one embodiment of the invention. Specifically,the full opcode field 1474 includes the format field 1440, the baseoperation field 1442, and the data element width (W) field 1464. Thebase operation field 1442 includes the prefix encoding field 1525, theopcode map field 1515, and the real opcode field 1530.

Register Index Field

FIG. 15C is a block diagram illustrating the fields of the specificvector friendly instruction format 1500 that make up the register indexfield 1444 according to one embodiment of the invention. Specifically,the register index field 1444 includes the REX field 1505, the REX′field 1510, the MODR/M.reg field 1544, the MODR/M.r/m field 1546, theVVVV field 1520, xxx field 1554, and the bbb field 1556.

Augmentation Operation Field

FIG. 15D is a block diagram illustrating the fields of the specificvector friendly instruction format 1500 that make up the augmentationoperation field 1450 according to one embodiment of the invention. Whenthe class (U) field 1468 contains 0, it signifies EVEX.U0 (class A1468A); when it contains 1, it signifies EVEX.U1 (class B 1468B). WhenU=0 and the MOD field 1542 contains 11 (signifying a no memory accessoperation), the alpha field 1452 (EVEX byte 3, bit [7]-EH) isinterpreted as the rs field 1452A. When the rs field 1452A contains a 1(round 1452A.1), the beta field 1454 (EVEX byte 3, bits[6:4]-SSS) isinterpreted as the round control field 1454A. The round control field1454A includes a one bit SAE field 1456 and a two bit round operationfield 1458. When the rs field 1452A contains a 0 (data transform1452A.2), the beta field 1454 (EVEX byte 3, bits[6:4]-SSS) isinterpreted as a three bit data transform field 1454B. When U=0 and theMOD field 1542 contains 00, 01, or 10 (signifying a memory accessoperation), the alpha field 1452 (EVEX byte 3, bit [7]-EH) isinterpreted as the eviction hint (EH) field 1452B and the beta field1454 (EVEX byte 3, bits[6:4]-SSS) is interpreted as a three bit datamanipulation field 1454C.

When U=1, the alpha field 1452 (EVEX byte 3, bit [7]-EH) is interpretedas the write mask control (Z) field 1452C. When U=1 and the MOD field1542 contains 11 (signifying a no memory access operation), part of thebeta field 1454 (EVEX byte 3, bit [4]-S₀) is interpreted as the RL field1457A; when it contains a 1 (round 1457A.1) the rest of the beta field1454 (EVEX byte 3, bit [6-5]-S₂₋₁) is interpreted as the round operationfield 1459A, while when the RL field 1457A contains a 0 (VSIZE 1457.A2)the rest of the beta field 1454 (EVEX byte 3, bit [6-5]-S₂₋₁) isinterpreted as the vector length field 1459B (EVEX byte 3, bit[6-5]-L₁₋₀). When U=1 and the MOD field 1542 contains 00, 01, or 10(signifying a memory access operation), the beta field 1454 (EVEX byte3, bits[6:4]-SSS) is interpreted as the vector length field 1459B (EVEXbyte 3, bit [6-5]-L₁₋₀) and the broadcast field 1457B (EVEX byte 3, bit[4]-B).

Exemplary Register Architecture

FIG. 16 is a block diagram of a register architecture 1600 according toone embodiment of the invention. In the embodiment illustrated, thereare 32 vector registers 1610 that are 512 bits wide; these registers arereferenced as zmm0 through zmm31. The lower order 256 bits of the lower16 zmm registers are overlaid on registers ymm0-16. The lower order 128bits of the lower 16 zmm registers (the lower order 128 bits of the ymmregisters) are overlaid on registers xmm0-15. The specific vectorfriendly instruction format 1500 operates on these overlaid registerfile as illustrated in the below tables.

Adjustable Vector Length Class Operations Registers InstructionTemplates A (Figure 1410, 1415, zmm registers (the that do not include14A; U = 0) 1425, 1430 vector length is the vector length 64 byte) field1459B B (Figure 1412 zmm registers (the 14B; U = 1) vector length is 64byte) Instruction templates B (Figure 1417, 1427 zmm, ymm, or xmm thatdo include 14B; U = 1) registers (the vector the vector length length is64 byte, 32 field 1459B byte, or 16 byte) depending on the vector lengthfield 1459B

In other words, the vector length field 1459B selects between a maximumlength and one or more other shorter lengths, where each such shorterlength is half the length of the preceding length; and instructionstemplates without the vector length field 1459B operate on the maximumvector length. Further, in one embodiment, the class B instructiontemplates of the specific vector friendly instruction format 1500operate on packed or scalar single/double-precision floating point dataand packed or scalar integer data. Scalar operations are operationsperformed on the lowest order data element position in an zmm/ymm/xmmregister; the higher order data element positions are either left thesame as they were prior to the instruction or zeroed depending on theembodiment.

Write mask registers 1615—in the embodiment illustrated, there are 8write mask registers (k0 through k7), each 64 bits in size. In analternate embodiment, the write mask registers 1615 are 16 bits in size.As previously described, in one embodiment of the invention, the vectormask register k0 cannot be used as a write mask; when the encoding thatwould normally indicate k0 is used for a write mask, it selects ahardwired write mask of 0xFFFF, effectively disabling write masking forthat instruction.

General-purpose registers 1625—in the embodiment illustrated, there aresixteen 64-bit general-purpose registers that are used along with theexisting x86 addressing modes to address memory operands. Theseregisters are referenced by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI,RSP, and R8 through R15.

Scalar floating point stack register file (x87 stack) 1645, on which isaliased the MMX packed integer flat register file 1650—in the embodimentillustrated, the x87 stack is an eight-element stack used to performscalar floating-point operations on 32/64/80-bit floating point datausing the x87 instruction set extension; while the MMX registers areused to perform operations on 64-bit packed integer data, as well as tohold operands for some operations performed between the MMX and XMMregisters.

Alternative embodiments of the invention may use wider or narrowerregisters. Additionally, alternative embodiments of the invention mayuse more, less, or different register files and registers.

Exemplary Core Architectures, Processors, and Computer Architectures

Processor cores may be implemented in different ways, for differentpurposes, and in different processors. For instance, implementations ofsuch cores may include: 1) a general purpose in-order core intended forgeneral-purpose computing; 2) a high performance general purposeout-of-order core intended for general-purpose computing; 3) a specialpurpose core intended primarily for graphics and/or scientific(throughput) computing. Implementations of different processors mayinclude: 1) a CPU including one or more general purpose in-order coresintended for general-purpose computing and/or one or more generalpurpose out-of-order cores intended for general-purpose computing; and2) a coprocessor including one or more special purpose cores intendedprimarily for graphics and/or scientific (throughput). Such differentprocessors lead to different computer system architectures, which mayinclude: 1) the coprocessor on a separate chip from the CPU; 2) thecoprocessor on a separate die in the same package as a CPU; 3) thecoprocessor on the same die as a CPU (in which case, such a coprocessoris sometimes referred to as special purpose logic, such as integratedgraphics and/or scientific (throughput) logic, or as special purposecores); and 4) a system on a chip that may include on the same die thedescribed CPU (sometimes referred to as the application core(s) orapplication processor(s)), the above described coprocessor, andadditional functionality. Exemplary core architectures are describednext, followed by descriptions of exemplary processors and computerarchitectures.

Exemplary Core Architectures

In-Order and Out-of-Order Core Block Diagram

FIG. 17A is a block diagram illustrating both an exemplary in-orderpipeline and an exemplary register renaming, out-of-orderissue/execution pipeline according to embodiments of the invention. FIG.17B is a block diagram illustrating both an exemplary embodiment of anin-order architecture core and an exemplary register renaming,out-of-order issue/execution architecture core to be included in aprocessor according to embodiments of the invention. The solid linedboxes in FIGS. 17A-B illustrate the in-order pipeline and in-order core,while the optional addition of the dashed lined boxes illustrates theregister renaming, out-of-order issue/execution pipeline and core. Giventhat the in-order aspect is a subset of the out-of-order aspect, theout-of-order aspect will be described.

In FIG. 17A, a processor pipeline 1700 includes a fetch stage 1702, alength decode stage 1704, a decode stage 1706, an allocation stage 1708,a renaming stage 1710, a scheduling (also known as a dispatch or issue)stage 1712, a register read/memory read stage 1714, an execute stage1716, a write back/memory write stage 1718, an exception handling stage1722, and a commit stage 1724.

FIG. 17B shows processor core 1790 including a front end unit 1730coupled to an execution engine unit 1750, and both are coupled to amemory unit 1770. The core 1790 may be a reduced instruction setcomputing (RISC) core, a complex instruction set computing (CISC) core,a very long instruction word (VLIW) core, or a hybrid or alternativecore type. As yet another option, the core 1790 may be a special-purposecore, such as, for example, a network or communication core, compressionengine, coprocessor core, general purpose computing graphics processingunit (GPGPU) core, graphics core, or the like.

The front end unit 1730 includes a branch prediction unit 1732 coupledto an instruction cache unit 1734, which is coupled to an instructiontranslation lookaside buffer (TLB) 1736, which is coupled to aninstruction fetch unit 1738, which is coupled to a decode unit 1740. Thedecode unit 1740 (or decoder) may decode instructions, and generate asan output one or more micro-operations, micro-code entry points,microinstructions, other instructions, or other control signals, whichare decoded from, or which otherwise reflect, or are derived from, theoriginal instructions. The decode unit 1740 may be implemented usingvarious different mechanisms. Examples of suitable mechanisms include,but are not limited to, look-up tables, hardware implementations,programmable logic arrays (PLAs), microcode read only memories (ROMs),etc. In one embodiment, the core 1790 includes a microcode ROM or othermedium that stores microcode for certain macroinstructions (e.g., indecode unit 1740 or otherwise within the front end unit 1730). Thedecode unit 1740 is coupled to a rename/allocator unit 1752 in theexecution engine unit 1750.

The execution engine unit 1750 includes the rename/allocator unit 1752coupled to a retirement unit 1754 and a set of one or more schedulerunit(s) 1756. The scheduler unit(s) 1756 represents any number ofdifferent schedulers, including reservations stations, centralinstruction window, etc. The scheduler unit(s) 1756 is coupled to thephysical register file(s) unit(s) 1758. Each of the physical registerfile(s) units 1758 represents one or more physical register files,different ones of which store one or more different data types, such asscalar integer, scalar floating point, packed integer, packed floatingpoint, vector integer, vector floating point, status (e.g., aninstruction pointer that is the address of the next instruction to beexecuted), etc. In one embodiment, the physical register file(s) unit1758 comprises a vector registers unit, a write mask registers unit, anda scalar registers unit. These register units may provide architecturalvector registers, vector mask registers, and general purpose registers.The physical register file(s) unit(s) 1758 is overlapped by theretirement unit 1754 to illustrate various ways in which registerrenaming and out-of-order execution may be implemented (e.g., using areorder buffer(s) and a retirement register file(s); using a futurefile(s), a history buffer(s), and a retirement register file(s);

using a register maps and a pool of registers; etc.). The retirementunit 1754 and the physical register file(s) unit(s) 1758 are coupled tothe execution cluster(s) 1760. The execution cluster(s) 1760 includes aset of one or more execution units 1762 and a set of one or more memoryaccess units 1764. The execution units 1762 may perform variousoperations (e.g., shifts, addition, subtraction, multiplication) and onvarious types of data (e.g., scalar floating point, packed integer,packed floating point, vector integer, vector floating point). Whilesome embodiments may include a number of execution units dedicated tospecific functions or sets of functions, other embodiments may includeonly one execution unit or multiple execution units that all perform allfunctions. The scheduler unit(s) 1756, physical register file(s) unit(s)1758, and execution cluster(s) 1760 are shown as being possibly pluralbecause certain embodiments create separate pipelines for certain typesof data/operations (e.g., a scalar integer pipeline, a scalar floatingpoint/packed integer/packed floating point/vector integer/vectorfloating point pipeline, and/or a memory access pipeline that each havetheir own scheduler unit, physical register file(s) unit, and/orexecution cluster—and in the case of a separate memory access pipeline,certain embodiments are implemented in which only the execution clusterof this pipeline has the memory access unit(s) 1764). It should also beunderstood that where separate pipelines are used, one or more of thesepipelines may be out-of-order issue/execution and the rest in-order.

The set of memory access units 1764 is coupled to the memory unit 1770,which includes a data TLB unit 1772 coupled to a data cache unit 1774coupled to a level 2 (L2) cache unit 1776. In one exemplary embodiment,the memory access units 1764 may include a load unit, a store addressunit, and a store data unit, each of which is coupled to the data TLBunit 1772 in the memory unit 1770. The instruction cache unit 1734 isfurther coupled to a level 2 (L2) cache unit 1776 in the memory unit1770. The L2 cache unit 1776 is coupled to one or more other levels ofcache and eventually to a main memory.

By way of example, the exemplary register renaming, out-of-orderissue/execution core architecture may implement the pipeline 1700 asfollows: 1) the instruction fetch 1738 performs the fetch and lengthdecoding stages 1702 and 1704; 2) the decode unit 1740 performs thedecode stage 1706; 3) the rename/allocator unit 1752 performs theallocation stage 1708 and renaming stage 1710; 4) the scheduler unit(s)1756 performs the schedule stage 1712; 5) the physical register file(s)unit(s) 1758 and the memory unit 1770 perform the register read/memoryread stage 1714; the execution cluster 1760 perform the execute stage1716; 6) the memory unit 1770 and the physical register file(s) unit(s)1758 perform the write back/memory write stage 1718; 7) various unitsmay be involved in the exception handling stage 1722; and 8) theretirement unit 1754 and the physical register file(s) unit(s) 1758perform the commit stage 1724.

The core 1790 may support one or more instructions sets (e.g., the x86instruction set (with some extensions that have been added with newerversions); the MIPS instruction set of MIPS Technologies of Sunnyvale,Calif.; the ARM instruction set (with optional additional extensionssuch as NEON) of ARM Holdings of Sunnyvale, Calif.), including theinstruction(s) described herein. In one embodiment, the core 1790includes logic to support a packed data instruction set extension (e.g.,AVX1, AVX2), thereby allowing the operations used by many multimediaapplications to be performed using packed data.

It should be understood that the core may support multithreading(executing two or more parallel sets of operations or threads), and maydo so in a variety of ways including time sliced multithreading,simultaneous multithreading (where a single physical core provides alogical core for each of the threads that physical core issimultaneously multithreading), or a combination thereof (e.g., timesliced fetching and decoding and simultaneous multithreading thereaftersuch as in the Intel® Hyperthreading technology).

While register renaming is described in the context of out-of-orderexecution, it should be understood that register renaming may be used inan in-order architecture. While the illustrated embodiment of theprocessor also includes separate instruction and data cache units1734/1774 and a shared L2 cache unit 1776, alternative embodiments mayhave a single internal cache for both instructions and data, such as,for example, a Level 1 (L1) internal cache, or multiple levels ofinternal cache. In some embodiments, the system may include acombination of an internal cache and an external cache that is externalto the core and/or the processor. Alternatively, all of the cache may beexternal to the core and/or the processor.

Specific Exemplary in-Order Core Architecture

FIGS. 18A-B illustrate a block diagram of a more specific exemplaryin-order core architecture, which core would be one of several logicblocks (including other cores of the same type and/or different types)in a chip. The logic blocks communicate through a high-bandwidthinterconnect network (e.g., a ring network) with some fixed functionlogic, memory I/O interfaces, and other necessary I/O logic, dependingon the application.

FIG. 18A is a block diagram of a single processor core, along with itsconnection to the on-die interconnect network 1802 and with its localsubset of the Level 2 (L2) cache 1804, according to embodiments of theinvention. In one embodiment, an instruction decoder 1800 supports thex86 instruction set with a packed data instruction set extension. An L1cache 1806 allows low-latency accesses to cache memory into the scalarand vector units. While in one embodiment (to simplify the design), ascalar unit 1808 and a vector unit 1810 use separate register sets(respectively, scalar registers 1812 and vector registers 1814) and datatransferred between them is written to memory and then read back in froma level 1 (L1) cache 1806, alternative embodiments of the invention mayuse a different approach (e.g., use a single register set or include acommunication path that allow data to be transferred between the tworegister files without being written and read back).

The local subset of the L2 cache 1804 is part of a global L2 cache thatis divided into separate local subsets, one per processor core. Eachprocessor core has a direct access path to its own local subset of theL2 cache 1804. Data read by a processor core is stored in its L2 cachesubset 1804 and can be accessed quickly, in parallel with otherprocessor cores accessing their own local L2 cache subsets. Data writtenby a processor core is stored in its own L2 cache subset 1804 and isflushed from other subsets, if necessary. The ring network ensurescoherency for shared data. The ring network is bi-directional to allowagents such as processor cores, L2 caches and other logic blocks tocommunicate with each other within the chip. Each ring data-path is1012-bits wide per direction.

FIG. 18B is an expanded view of part of the processor core in FIG. 18Aaccording to embodiments of the invention. FIG. 18B includes an L1 datacache 1806A part of the L1 cache 1804, as well as more detail regardingthe vector unit 1810 and the vector registers 1814. Specifically, thevector unit 1810 is a 16-wide vector processing unit (VPU) (see the16-wide ALU 1828), which executes one or more of integer,single-precision float, and double-precision float instructions. The VPUsupports swizzling the register inputs with swizzle unit 1820, numericconversion with numeric convert units 1822A-B, and replication withreplication unit 1824 on the memory input. Write mask registers 1826allow predicating resulting vector writes.

Processor with Integrated Memory Controller and Graphics

FIG. 19 is a block diagram of a processor 1900 that may have more thanone core, may have an integrated memory controller, and may haveintegrated graphics according to embodiments of the invention. The solidlined boxes in FIG. 19 illustrate a processor 1900 with a single core1902A, a system agent 1910, a set of one or more bus controller units1916, while the optional addition of the dashed lined boxes illustratesan alternative processor 1900 with multiple cores 1902A-N, a set of oneor more integrated memory controller unit(s) 1914 in the system agentunit 1910, and special purpose logic 1908.

Thus, different implementations of the processor 1900 may include: 1) aCPU with the special purpose logic 1908 being integrated graphics and/orscientific (throughput) logic (which may include one or more cores), andthe cores 1902A-N being one or more general purpose cores (e.g., generalpurpose in-order cores, general purpose out-of-order cores, acombination of the two); 2) a coprocessor with the cores 1902A-N being alarge number of special purpose cores intended primarily for graphicsand/or scientific (throughput); and 3) a coprocessor with the cores1902A-N being a large number of general purpose in-order cores. Thus,the processor 1900 may be a general-purpose processor, coprocessor orspecial-purpose processor, such as, for example, a network orcommunication processor, compression engine, graphics processor, GPGPU(general purpose graphics processing unit), a high-throughput manyintegrated core (MIC) coprocessor (including 30 or more cores), embeddedprocessor, or the like. The processor may be implemented on one or morechips. The processor 1900 may be a part of and/or may be implemented onone or more substrates using any of a number of process technologies,such as, for example, BiCMOS, CMOS, or NMOS.

The memory hierarchy includes one or more levels of cache within thecores, a set or one or more shared cache units 1906, and external memory(not shown) coupled to the set of integrated memory controller units1914. The set of shared cache units 1906 may include one or moremid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), orother levels of cache, a last level cache (LLC), and/or combinationsthereof. While in one embodiment a ring based interconnect unit 1912interconnects the integrated graphics logic 1908, the set of sharedcache units 1906, and the system agent unit 1910/integrated memorycontroller unit(s) 1914, alternative embodiments may use any number ofwell-known techniques for interconnecting such units. In one embodiment,coherency is maintained between one or more cache units 1906 and cores1902-A-N.

In some embodiments, one or more of the cores 1902A-N are capable ofmulti-threading. The system agent 1910 includes those componentscoordinating and operating cores 1902A-N. The system agent unit 1910 mayinclude for example a power control unit (PCU) and a display unit. ThePCU may be or include logic and components needed for regulating thepower state of the cores 1902A-N and the integrated graphics logic 1908.The display unit is for driving one or more externally connecteddisplays.

The cores 1902A-N may be homogenous or heterogeneous in terms ofarchitecture instruction set; that is, two or more of the cores 1902A-Nmay be capable of execution the same instruction set, while others maybe capable of executing only a subset of that instruction set or adifferent instruction set.

Exemplary Computer Architectures

FIGS. 20-23 are block diagrams of exemplary computer architectures.Other system designs and configurations known in the arts for laptops,desktops, handheld PCs, personal digital assistants, engineeringworkstations, servers, network devices, network hubs, switches, embeddedprocessors, digital signal processors (DSPs), graphics devices, videogame devices, set-top boxes, micro controllers, cell phones, portablemedia players, hand held devices, and various other electronic devices,are also suitable. In general, a huge variety of systems or electronicdevices capable of incorporating a processor and/or other executionlogic as disclosed herein are generally suitable.

Referring now to FIG. 20, shown is a block diagram of a system 2000 inaccordance with one embodiment of the present invention. The system 2000may include one or more processors 2010, 2015, which are coupled to acontroller hub 2020. In one embodiment the controller hub 2020 includesa graphics memory controller hub (GMCH) 2090 and an Input/Output Hub(IOH) 2050 (which may be on separate chips); the GMCH 2090 includesmemory and graphics controllers to which are coupled memory 2040 and acoprocessor 2045; the IOH 2050 is couples input/output (I/O) devices2060 to the GMCH 2090. Alternatively, one or both of the memory andgraphics controllers are integrated within the processor (as describedherein), the memory 2040 and the coprocessor 2045 are coupled directlyto the processor 2010, and the controller hub 2020 in a single chip withthe IOH 2050.

The optional nature of additional processors 2015 is denoted in FIG. 20with broken lines. Each processor 2010, 2015 may include one or more ofthe processing cores described herein and may be some version of theprocessor 1900.

The memory 2040 may be, for example, dynamic random access memory(DRAM), phase change memory (PCM), or a combination of the two. For atleast one embodiment, the controller hub 2020 communicates with theprocessor(s) 2010, 2015 via a multi-drop bus, such as a frontside bus(FSB), point-to-point interface such as QuickPath Interconnect (QPI), orsimilar connection 2095.

In one embodiment, the coprocessor 2045 is a special-purpose processor,such as, for example, a high-throughput MIC processor, a network orcommunication processor, compression engine, graphics processor, GPGPU,embedded processor, or the like. In one embodiment, controller hub 2020may include an integrated graphics accelerator.

There can be a variety of differences between the physical resources2010, 2015 in terms of a spectrum of metrics of merit includingarchitectural, microarchitectural, thermal, power consumptioncharacteristics, and the like.

In one embodiment, the processor 2010 executes instructions that controldata processing operations of a general type. Embedded within theinstructions may be coprocessor instructions. The processor 2010recognizes these coprocessor instructions as being of a type that shouldbe executed by the attached coprocessor 2045. Accordingly, the processor2010 issues these coprocessor instructions (or control signalsrepresenting coprocessor instructions) on a coprocessor bus or otherinterconnect, to coprocessor 2045. Coprocessor(s) 2045 accept andexecute the received coprocessor instructions.

Referring now to FIG. 21, shown is a block diagram of a first morespecific exemplary system 2100 in accordance with an embodiment of thepresent invention. As shown in FIG. 21, multiprocessor system 2100 is apoint-to-point interconnect system, and includes a first processor 2170and a second processor 2180 coupled via a point-to-point interconnect2150. Each of processors 2170 and 2180 may be some version of theprocessor 1900. In one embodiment of the invention, processors 2170 and2180 are respectively processors 2010 and 2015, while coprocessor 2138is coprocessor 2045. In another embodiment, processors 2170 and 2180 arerespectively processor 2010 coprocessor 2045.

Processors 2170 and 2180 are shown including integrated memorycontroller (IMC) units 2172 and 2182, respectively. Processor 2170 alsoincludes as part of its bus controller units point-to-point (P-P)interfaces 2176 and 2178; similarly, second processor 2180 includes P-Pinterfaces 2186 and 2188. Processors 2170, 2180 may exchange informationvia a point-to-point (P-P) interface 2150 using P-P interface circuits2178, 2188. As shown in FIG. 21, IMCs 2172 and 2182 couple theprocessors to respective memories, namely a memory 2132 and a memory2134, which may be portions of main memory locally attached to therespective processors.

Processors 2170, 2180 may each exchange information with a chipset 2190via individual P-P interfaces 2152, 2154 using point to point interfacecircuits 2176, 2194, 2186, 2198. Chipset 2190 may optionally exchangeinformation with the coprocessor 2138 via a high-performance interface2139. In one embodiment, the coprocessor 2138 is a special-purposeprocessor, such as, for example, a high-throughput MIC processor, anetwork or communication processor, compression engine, graphicsprocessor, GPGPU, embedded processor, or the like.

A shared cache (not shown) may be included in either processor oroutside of both processors, yet connected with the processors via P-Pinterconnect, such that either or both processors' local cacheinformation may be stored in the shared cache if a processor is placedinto a low power mode.

Chipset 2190 may be coupled to a first bus 2116 via an interface 2196.In one embodiment, first bus 2116 may be a Peripheral ComponentInterconnect (PCI) bus, or a bus such as a PCI Express bus or anotherthird generation I/O interconnect bus, although the scope of the presentinvention is not so limited.

As shown in FIG. 21, various I/O devices 2114 may be coupled to firstbus 2116, along with a bus bridge 2118 which couples first bus 2116 to asecond bus 2120. In one embodiment, one or more additional processor(s)2115, such as coprocessors, high-throughput MIC processors, GPGPU's,accelerators (such as, e.g., graphics accelerators or digital signalprocessing (DSP) units), field programmable gate arrays, or any otherprocessor, are coupled to first bus 2116. In one embodiment, second bus2120 may be a low pin count (LPC) bus. Various devices may be coupled toa second bus 2120 including, for example, a keyboard and/or mouse 2122,communication devices 2127 and a storage unit 2128 such as a disk driveor other mass storage device which may include instructions/code anddata 2130, in one embodiment. Further, an audio I/O 2124 may be coupledto the second bus 2120. Note that other architectures are possible. Forexample, instead of the point-to-point architecture of FIG. 21, a systemmay implement a multi-drop bus or other such architecture.

Referring now to FIG. 22, shown is a block diagram of a second morespecific exemplary system 2200 in accordance with an embodiment of thepresent invention. Like elements in FIGS. 21 and 22 bear like referencenumerals, and certain aspects of FIG. 21 have been omitted from FIG. 22in order to avoid obscuring other aspects of FIG. 22.

FIG. 22 illustrates that the processors 2170, 2180 may includeintegrated memory and I/O control logic (“CL”) 2172 and 2182,respectively. Thus, the CL 2172, 2182 include integrated memorycontroller units and include I/O control logic. FIG. 22 illustrates thatnot only are the memories 2132, 2134 coupled to the CL 2172, 2182, butalso that I/O devices 2214 are also coupled to the control logic 2172,2182. Legacy I/O devices 2215 are coupled to the chipset 2190.

Referring now to FIG. 23, shown is a block diagram of a SoC 2300 inaccordance with an embodiment of the present invention. Similar elementsin FIG. 19 bear like reference numerals. Also, dashed lined boxes areoptional features on more advanced SoCs. In FIG. 23, an interconnectunit(s) 2302 is coupled to: an application processor 2310 which includesa set of one or more cores 202A-N and shared cache unit(s) 1906; asystem agent unit 1910; a bus controller unit(s) 1916; an integratedmemory controller unit(s) 1914; a set or one or more coprocessors 2320which may include integrated graphics logic, an image processor, anaudio processor, and a video processor; an static random access memory(SRAM) unit 2330; a direct memory access (DMA) unit 2332; and a displayunit 2340 for coupling to one or more external displays. In oneembodiment, the coprocessor(s) 2320 include a special-purpose processor,such as, for example, a network or communication processor, compressionengine, GPGPU, a high-throughput MIC processor, embedded processor, orthe like.

Embodiments of the mechanisms disclosed herein may be implemented inhardware, software, firmware, or a combination of such implementationapproaches. Embodiments of the invention may be implemented as computerprograms or program code executing on programmable systems comprising atleast one processor, a storage system (including volatile andnon-volatile memory and/or storage elements), at least one input device,and at least one output device.

Program code, such as code 2130 illustrated in FIG. 21, may be appliedto input instructions to perform the functions described herein andgenerate output information. The output information may be applied toone or more output devices, in known fashion. For purposes of thisapplication, a processing system includes any system that has aprocessor, such as, for example; a digital signal processor (DSP), amicrocontroller, an application specific integrated circuit (ASIC), or amicroprocessor.

The program code may be implemented in a high level procedural or objectoriented programming language to communicate with a processing system.The program code may also be implemented in assembly or machinelanguage, if desired. In fact, the mechanisms described herein are notlimited in scope to any particular programming language. In any case,the language may be a compiled or interpreted language.

One or more aspects of at least one embodiment may be implemented byrepresentative instructions stored on a machine-readable medium whichrepresents various logic within the processor, which when read by amachine causes the machine to fabricate logic to perform the techniquesdescribed herein. Such representations, known as “IP cores” may bestored on a tangible, machine readable medium and supplied to variouscustomers or manufacturing facilities to load into the fabricationmachines that actually make the logic or processor.

Such machine-readable storage media may include, without limitation,non-transitory, tangible arrangements of articles manufactured or formedby a machine or device, including storage media such as hard disks, anyother type of disk including floppy disks, optical disks, compact diskread-only memories (CD-ROMs), compact disk rewritable's (CD-RWs), andmagneto-optical disks, semiconductor devices such as read-only memories(ROMs), random access memories (RAMs) such as dynamic random accessmemories (DRAMs), static random access memories (SRAMs), erasableprogrammable read-only memories (EPROMs), flash memories, electricallyerasable programmable read-only memories (EEPROMs), phase change memory(PCM), magnetic or optical cards, or any other type of media suitablefor storing electronic instructions.

Accordingly, embodiments of the invention also include non-transitory,tangible machine-readable media containing instructions or containingdesign data, such as Hardware Description Language (HDL), which definesstructures, circuits, apparatuses, processors and/or system featuresdescribed herein. Such embodiments may also be referred to as programproducts.

Emulation (Including Binary Translation, Code Morphing, Etc.)

In some cases, an instruction converter may be used to convert aninstruction from a source instruction set to a target instruction set.For example, the instruction converter may translate (e.g., using staticbinary translation, dynamic binary translation including dynamiccompilation), morph, emulate, or otherwise convert an instruction to oneor more other instructions to be processed by the core. The instructionconverter may be implemented in software, hardware, firmware, or acombination thereof. The instruction converter may be on processor, offprocessor, or part on and part off processor.

FIG. 24 is a block diagram contrasting the use of a software instructionconverter to convert binary instructions in a source instruction set tobinary instructions in a target instruction set according to embodimentsof the invention. In the illustrated embodiment, the instructionconverter is a software instruction converter, although alternativelythe instruction converter may be implemented in software, firmware,hardware, or various combinations thereof. FIG. 24 shows a program in ahigh level language 2402 may be compiled using an x86 compiler 2404 togenerate x86 binary code 2406 that may be natively executed by aprocessor with at least one x86 instruction set core 2416. The processorwith at least one x86 instruction set core 2416 represents any processorthat can perform substantially the same functions as an Intel processorwith at least one x86 instruction set core by compatibly executing orotherwise processing (1) a substantial portion of the instruction set ofthe Intel x86 instruction set core or (2) object code versions ofapplications or other software targeted to run on an Intel processorwith at least one x86 instruction set core, in order to achievesubstantially the same result as an Intel processor with at least onex86 instruction set core. The x86 compiler 2404 represents a compilerthat is operable to generate x86 binary code 2406 (e.g., object code)that can, with or without additional linkage processing, be executed onthe processor with at least one x86 instruction set core 2416.Similarly, FIG. 24 shows the program in the high level language 2402 maybe compiled using an alternative instruction set compiler 2408 togenerate alternative instruction set binary code 2410 that may benatively executed by a processor without at least one x86 instructionset core 2414 (e.g., a processor with cores that execute the MIPSinstruction set of MIPS Technologies of Sunnyvale, Calif. and/or thatexecute the ARM instruction set of ARM Holdings of Sunnyvale, Calif.).The instruction converter 2412 is used to convert the x86 binary code2406 into code that may be natively executed by the processor without anx86 instruction set core 2414. This converted code is not likely to bethe same as the alternative instruction set binary code 2410 because aninstruction converter capable of this is difficult to make; however, theconverted code will accomplish the general operation and be made up ofinstructions from the alternative instruction set. Thus, the instructionconverter 2412 represents software, firmware, hardware, or a combinationthereof that, through emulation, simulation or any other process, allowsa processor or other electronic device that does not have an x86instruction set processor or core to execute the x86 binary code 2406.

Components, features, and details described for any of FIGS. 3-12 mayalso optionally apply to any of FIGS. 1-2. Moreover, components,features, and details described for any of the apparatus may alsooptionally apply to any of the methods, which in embodiments may beperformed by and/or with such apparatus. Any of the processors describedherein may be included in any of the computer systems disclosed herein.In some embodiments, the instructions may have features or details ofthe instruction formats disclosed herein, although this is not required.

In the description and claims, the terms “coupled” and/or “connected,”along with their derivatives, may have be used. These terms are notintended as synonyms for each other. Rather, in embodiments, “connected”may be used to indicate that two or more elements are in direct physicaland/or electrical contact with each other. “Coupled” may mean that twoor more elements are in direct physical and/or electrical contact witheach other. However, “coupled” may also mean that two or more elementsare not in direct contact with each other, but yet still co-operate orinteract with each other. For example, an execution unit may be coupledwith a register and/or a decode unit through one or more interveningcomponents. In the figures, arrows are used to show connections andcouplings.

The term “and/or” may have been used. As used herein, the term “and/or”means one or the other or both (e.g., A and/or B means A or B or both Aand B).

In the description above, specific details have been set forth in orderto provide a thorough understanding of the embodiments. However, otherembodiments may be practiced without some of these specific details. Thescope of the invention is not to be determined by the specific examplesprovided above, but only by the claims below. In other instances,well-known circuits, structures, devices, and operations have been shownin block diagram form and/or without detail in order to avoid obscuringthe understanding of the description. Where considered appropriate,reference numerals, or terminal portions of reference numerals, havebeen repeated among the figures to indicate corresponding or analogouselements, which may optionally have similar or the same characteristics,unless specified or clearly apparent otherwise.

Some embodiments include an article of manufacture (e.g., a computerprogram product) that includes a machine-readable medium. The medium mayinclude a mechanism that provides, for example stores, information in aform that is readable by the machine. The machine-readable medium mayprovide, or have stored thereon, an instruction or sequence ofinstructions, that if and/or when executed by a machine are operable tocause the machine to perform and/or result in the machine performing oneor operations, methods, or techniques disclosed herein.

In some embodiments, the machine-readable medium may include anon-transitory machine-readable storage medium. For example, thenon-transitory machine-readable storage medium may include a floppydiskette, an optical storage medium, an optical disk, an optical datastorage device, a CD-ROM, a magnetic disk, a magneto-optical disk, aread only memory (ROM), a programmable ROM (PROM), anerasable-and-programmable ROM (EPROM), anelectrically-erasable-and-programmable ROM (EEPROM), a random accessmemory (RAM), a static-RAM (SRAM), a dynamic-RAM (DRAM), a Flash memory,a phase-change memory, a phase-change data storage material, anon-volatile memory, a non-volatile data storage device, anon-transitory memory, a non-transitory data storage device, or thelike. The non-transitory machine-readable storage medium does notconsist of a transitory propagated signal.

Examples of suitable machines include, but are not limited to, ageneral-purpose processor, a special-purpose processor, a digital logiccircuit, an integrated circuit, or the like. Still other examples ofsuitable machines include a computer system or other electronic devicethat includes a processor, a digital logic circuit, or an integratedcircuit. Examples of such computer systems or electronic devicesinclude, but are not limited to, desktop computers, laptop computers,notebook computers, tablet computers, netbooks, smartphones, cellularphones, servers, network devices (e.g., routers and switches.), MobileInternet devices (MIDs), media players, smart televisions, nettops,set-top boxes, and video game controllers.

Reference throughout this specification to “one embodiment,” “anembodiment,” “one or more embodiments,” “some embodiments,” for example,indicates that a particular feature may be included in the practice ofthe invention but is not necessarily required to be. Similarly, in thedescription various features are sometimes grouped together in a singleembodiment, Figure, or description thereof for the purpose ofstreamlining the disclosure and aiding in the understanding of variousinventive aspects. This method of disclosure, however, is not to beinterpreted as reflecting an intention that the invention requires morefeatures than are expressly recited in each claim. Rather, as thefollowing claims reflect, inventive aspects lie in less than allfeatures of a single disclosed embodiment. Thus, the claims followingthe Detailed Description are hereby expressly incorporated into thisDetailed Description, with each claim standing on its own as a separateembodiment of the invention.

EXAMPLE EMBODIMENTS

The following examples pertain to further embodiments. Specifics in theexamples may be used anywhere in one or more embodiments.

Example 1 is a processor that includes a plurality of packed dataregisters, and a decode unit to decode an instruction. The instructionis to indicate a first source operand that is to have at least one laneof bits. The instruction is also to indicate a second source packed dataoperand that is to have a number of sub-lane sized bit selectionelements. The processor also includes an execution unit coupled with thepacked data registers and the decode unit. The execution unit, inresponse to the instruction, is to store a result operand in adestination storage location that is to be indicated by the instruction.The result operand is to include, a different corresponding bit for eachof the number of sub-lane sized bit selection elements. A value of eachbit of the result operand corresponding to a sub-lane sized bitselection element is to be that of a bit of a corresponding lane ofbits, of the at least one lane of bits of the first source operand,which is indicated by the corresponding sub-lane sized bit selectionelement.

Example 2 includes the processor of Example 1, in which the number ofsub-lane sized bit selection elements include a plurality of subsetsthat each correspond to a different one of a plurality of lanes of bits.Also, the execution unit, in response to the instruction, is to use eachsubset of the sub-lane sized bit selection elements to select bits fromwithin only a corresponding lane of bits.

Example 3 includes the processor of Example 2, in which the executionunit, in response to the instruction, is to store the result operand ina packed data register having the plurality of lanes of bits.

Example 4 includes the processor of Example 3, in which the executionunit, in response to the instruction, is to store the bits selected byeach subset of the sub-lane sized bit selection elements in acorresponding lane of bits of the packed data register.

Example 5 includes the processor of Example 4, in which the executionunit, in response to the instruction, is to store at least one replicaof the bits selected by each subset of the sub-lane sized bit selectionelements in the corresponding lane of bits of the packed data register.

Example 6 includes the processor of Example 5, in which the decode unitis to decode the instruction that is to indicate a source predicate maskoperand. Also, the execution unit, in response to the instruction, isalso optionally to use the source predicate mask operand to predicatestorage of the bits selected by each subset of the sub-lane sized bitselection elements and replicas thereof in the corresponding lane ofbits of the packed data register.

Example 7 includes the processor of Example 1, in which each sub-lanesized bit selection element corresponds to a bit of the result operandin a same relative position. Also, optionally in which the second sourcepacked data operand has at least sixteen sub-lane sized bit selectionelements.

Example 8 includes the processor of Example 1, in which the executionunit, in response to the instruction, is to store the result operand inthe destination storage location which is a packed data operation maskregister.

Example 9 includes the processor of Example 1, in which the executionunit, in response to the instruction, is to store the result operand inthe destination storage location which is a general-purpose register.

Example 10 includes the processor of Example 1, in which the decode unitis to decode the instruction that is to indicate the first sourceoperand that is to have a single lane of bits, in which all of thenumber of sub-lane sized bit selection elements are to correspond to thesingle lane of bits. Also, optionally in which the execution unit, inresponse to the instruction, is to store a bit of the single lane ofbits to the result operand for each of the number of sub-lane sized bitselection elements.

Example 11 includes the processor of any one of Examples 1 to 9, inwhich the decode unit is to decode the instruction that is to indicatethe first source operand is to have a plurality of lanes of bits.

Example 12 includes the processor of any one of Examples 1 to 9, inwhich the decode unit is to decode the instruction that is to indicatethe first source operand that is to have a single lane of bits, and inwhich the processor, in response to the instruction, is to replicate thesingle lane of bits of the first source operand a plurality of times tocreate a plurality of lanes of bits.

Example 13 includes the processor of any one of Examples 1 to 9, inwhich the decode unit is to decode the instruction that is to indicatethe first source operand that is to have at least one 64-bit lane ofbits, and is to indicate the second source packed data operand that isto have the number of at least 6-bit sized bit selection elements.

Example 14 includes the processor of Example 13, in which each at least6-bit bit selection element is in a different corresponding 8-bit byteof the second source packed data operand. Also, optionally in which thesecond source packed data operand has at least sixteen bit selectionelements.

Example 15 includes the processor of any one of Examples 1 to 9, inwhich the decode unit is to decode the instruction that is to indicatethe second source packed data operand that is to have a same number ofsub-lane sized bit selection elements as a number of bits in each of theat least one lane of bits of the first source operand.

Example 16 is a method in a processor that includes receiving aninstruction indicating a first source operand having at least one laneof bits. The instruction also indicates a second source packed dataoperand having a number of sub-lane sized bit selection elements. Themethod also includes storing a result operand in a destination storagelocation indicated by the instruction in response to the instruction.The result operand includes a different corresponding bit for each ofthe number of sub-lane sized bit selection elements. A value of each bitof the result operand that corresponds to a sub-lane sized bit selectionelement being that of a bit of a corresponding lane of bits, of the atleast one lane of bits of the first source operand, indicated by thecorresponding sub-lane sized bit selection element.

Example 17 includes the method of Example 16, in which storing includesstoring the result operand in the destination storage location which isa predicate mask register. Also, optionally in which each bit of theresult operand corresponds to a sub-lane sized bit selection element ina same relative position.

Example 18 includes the method of Example 16, in which receivingincludes receiving the instruction indicating the second source packeddata operand having the number of sub-lane sized bit selection elementsincluding a plurality of subsets that each correspond to a different oneof a plurality of lanes of bits. The method also optionally includesusing each subset of the sub-lane sized bit selection elements to selectbits from within only a corresponding lane of bits.

Example 19 includes the method of Example 18, in which storing includesstoring the result operand in a packed data register having a pluralityof lanes of bits, and in which a lane of bits of the result operandincludes the bits selected by the corresponding subset of the sub-lanesized bit selection elements as well as a plurality of replicas of thebits selected by the corresponding subset.

Example 20 includes the method of Example 16, in which receivingincludes receiving the instruction indicating the first source operandhaving a plurality of 64-bit lanes of bits, and indicating the secondsource packed data operand having the number of at least 6-bit bitselection elements arranged as a plurality of sets each corresponding toa different one of the 64-bit lanes of bits.

Example 21 includes the method of Example 16, in which receivingincludes receiving the instruction that indicates the first sourceoperand that has a single lane of bits. Also, the method may optionallyinclude, in response to the instruction, replicating the single lane ofbits of the first source operand a plurality of times to create aplurality of lanes of bits.

Example 22 is a system to process instructions including aninterconnect, and a processor coupled with the interconnect. Theprocessor is to receive an instruction that is to indicate a firstsource operand that is to have at least one lane of bits, and toindicate a second source packed data operand that is to have a number ofsub-lane sized bit selection elements. The instruction is also toindicate a destination storage location. The processor, in response tothe instruction, is to store a result operand in the destination storagelocation. The result operand is to include a different corresponding bitfor each of the number of sub-lane sized bit selection elements. A valueof each bit of the result operand corresponding to a sub-lane sized bitselection element to be that of a bit of a corresponding lane of bits,of the at least one lane of bits of the first source operand, which isindicated by the corresponding sub-lane sized bit selection element. Thesystem also includes a dynamic random access memory (DRAM) coupled withthe interconnect.

Example 23 includes the system of Example 22, in which the number ofsub-lane sized bit selection elements include a plurality of subsetsthat each correspond to a different one of a plurality of lanes of bits.Also, optionally in which the processor, in response to the instruction,is to use each subset of the sub-lane sized bit selection elements toselect bits from within only a corresponding lane of bits.

Example 24 is an article of manufacture including a non-transitorymachine-readable storage medium. The non-transitory machine-readablestorage medium stores an instruction. The instruction is to indicate afirst source operand having at least one lane of bits, and to indicate asecond source packed data operand having a number of sub-lane sized bitselection elements. The instruction if executed by a machine is to causethe machine to perform operations including storing a result operand ina destination storage location indicated by the instruction. The resultoperand is to include a different corresponding bit for each of thenumber of sub-lane sized bit selection elements. A value of each bit ofthe result operand that corresponds to a sub-lane sized bit selectionelement is to be that of a bit of a corresponding lane of bits, of theat least one lane of bits of the first source operand, indicated by thecorresponding sub-lane sized bit selection element.

Example 25 includes the article of manufacture of Example 24, in whichthe instruction if executed by the machine is to cause the machine tostore the result operand in a predicate mask register.

Example 26 is a processor or other apparatus that is operative toperform the method of any one of Examples 16 to 21.

Example 27 is a processor or other apparatus that includes means forperforming the method of any one of Examples 16 to 21.

Example 28 is a processor or other apparatus that includes modules toperform the method of any one of Examples 16 to 21.

Example 29 is a processor that includes any combination of modulesand/or units and/or logic and/or circuitry and/or means for performingthe method of any one of Examples 16 to 21.

Example 30 is an article of manufacture that includes an optionallynon-transitory machine-readable medium, which optionally stores orotherwise provides an instruction, which if and/or when executed by aprocessor, computer system, electronic device, or other machine, isoperative to cause the machine to perform the method of any one ofExamples 16 to 21.

Example 31 is a computer system, other electronic device, or otherapparatus including a bus or other interconnect, the processor of anyone of Examples 1 to 15 coupled with the interconnect, and at least onecomponent coupled with the interconnect that is selected from a dynamicrandom access memory (DRAM), a network interface, a graphics chip, awireless communications chip, a Global System for Mobile Communications(GSM) antenna, a phase change memory, and a video camera.

Example 32 is a processor or other apparatus substantially as describedherein.

Example 33 is a processor or other apparatus that is operative toperform any method substantially as described herein.

Example 34 is a processor or other apparatus that is operative toperform any bit shuffle instruction substantially as described herein.

Example 35 is a processor or other apparatus including a decode unit todecode instructions of a first instruction set. The decode unit is toreceive one or more instructions of the first instruction set thatemulate a first instruction. The first instruction may be any bitshuffle instruction substantially as disclosed herein, and is to be of asecond different instruction set. The processor or other apparatus alsoincludes one or more execution units coupled with the decode unit toexecute the one or more instructions of the first instruction set. Theone or more execution units, in response to the one or more instructionsof the first instruction set, are to store a result in a destination.The result may include any result of a bit shuffle instructionsubstantially as disclosed herein for the first instruction.

Example 36 is a computer system or other electronic device that includesa processor having a decode unit to decode instructions of a firstinstruction set. The processor also has one or more execution units. Theelectronic device also includes a storage device coupled with theprocessor. The storage device is to store a first instruction, which maybe any bit shuffle instruction substantially as disclosed herein, andwhich is to be of a second different instruction set. The storage deviceis also to store instructions to convert the first instruction into oneor more instructions of the first instruction set. The one or moreinstructions of the first instruction set, when performed by theprocessor, are to cause the processor to store a result in adestination. The result may include any result of a bit shuffleinstruction substantially as disclosed herein for the first instruction.

What is claimed is:
 1. A processor comprising: a plurality of packeddata registers; a decode unit to decode an instruction, the instructionto indicate a first source operand that is to have at least one lane ofbits, and the instruction to indicate a second source packed dataoperand that is to have a number of sub-lane sized bit selectionelements; and an execution unit coupled with the packed data registersand the decode unit, the execution unit, in response to the instruction,to store a result operand in a destination storage location that is tobe indicated by the instruction, the result operand to include, adifferent corresponding bit for each of the number of sub-lane sized bitselection elements, a value of each bit of the result operandcorresponding to a sub-lane sized bit selection element to be that of abit of a corresponding lane of bits, of the at least one lane of bits ofthe first source operand, which is indicated by the correspondingsub-lane sized bit selection element.
 2. The processor of claim 1,wherein the number of sub-lane sized bit selection elements include aplurality of subsets that each correspond to a different one of aplurality of lanes of bits, and wherein the execution unit, in responseto the instruction, is to use each subset of the sub-lane sized bitselection elements to select bits from within only a corresponding laneof bits.
 3. The processor of claim 2, wherein the execution unit, inresponse to the instruction, is to store the result operand in a packeddata register having the plurality of lanes of bits.
 4. The processor ofclaim 3, wherein the execution unit, in response to the instruction, isto store the bits selected by each subset of the sub-lane sized bitselection elements in a corresponding lane of bits of the packed dataregister.
 5. The processor of claim 4, wherein the execution unit, inresponse to the instruction, is to store at least one replica of thebits selected by each subset of the sub-lane sized bit selectionelements in the corresponding lane of bits of the packed data register.6. The processor of claim 5, wherein the decode unit is to decode theinstruction that is to indicate a source predicate mask operand, andwherein the execution unit, in response to the instruction, is to usethe source predicate mask operand to predicate storage of the bitsselected by each subset of the sub-lane sized bit selection elements andreplicas thereof in the corresponding lane of bits of the packed dataregister.
 7. The processor of claim 1, wherein each sub-lane sized bitselection element corresponds to a bit of the result operand in a samerelative position, and wherein the second source packed data operand hasat least sixteen sub-lane sized bit selection elements.
 8. The processorof claim 1, wherein the execution unit, in response to the instruction,is to store the result operand in the destination storage location whichis a packed data operation mask register.
 9. The processor of claim 1,wherein the execution unit, in response to the instruction, is to storethe result operand in the destination storage location which is ageneral-purpose register.
 10. The processor of claim 1, wherein thedecode unit is to decode the instruction that is to indicate the firstsource operand that is to have a single lane of bits, wherein all of thenumber of sub-lane sized bit selection elements are to correspond to thesingle lane of bits, and wherein the execution unit, in response to theinstruction, is to store a bit of the single lane of bits to the resultoperand for each of the number of sub-lane sized bit selection elements.11. The processor of claim 1, wherein the decode unit is to decode theinstruction that is to indicate the first source operand is to have aplurality of lanes of bits.
 12. The processor of claim 1, wherein thedecode unit is to decode the instruction that is to indicate the firstsource operand that is to have a single lane of bits, and wherein theprocessor, in response to the instruction, is to replicate the singlelane of bits of the first source operand a plurality of times to createa plurality of lanes of bits.
 13. The processor of claim 1, wherein thedecode unit is to decode the instruction that is to indicate the firstsource operand that is to have at least one 64-bit lane of bits, and isto indicate the second source packed data operand that is to have thenumber of at least 6-bit sized bit selection elements.
 14. The processorof claim 13, wherein each at least 6-bit bit selection element is in adifferent corresponding 8-bit byte of the second source packed dataoperand, and wherein the second source packed data operand has at leastsixteen bit selection elements.
 15. The processor of claim 1, whereinthe decode unit is to decode the instruction that is to indicate thesecond source packed data operand that is to have a same number ofsub-lane sized bit selection elements as a number of bits in each of theat least one lane of bits of the first source operand.
 16. A method in aprocessor comprising: receiving an instruction, the instructionindicating a first source operand having at least one lane of bits, andthe instruction indicating a second source packed data operand having anumber of sub-lane sized bit selection elements; and storing a resultoperand in a destination storage location indicated by the instructionin response to the instruction, the result operand including a differentcorresponding bit for each of the number of sub-lane sized bit selectionelements, a value of each bit of the result operand that corresponds toa sub-lane sized bit selection element being that of a bit of acorresponding lane of bits, of the at least one lane of bits of thefirst source operand, indicated by the corresponding sub-lane sized bitselection element.
 17. The method of claim 16, wherein storing comprisesstoring the result operand in the destination storage location which isa predicate mask register, and wherein each bit of the result operandcorresponds to a sub-lane sized bit selection element in a same relativeposition.
 18. The method of claim 16, wherein receiving comprisesreceiving the instruction indicating the second source packed dataoperand having the number of sub-lane sized bit selection elementsincluding a plurality of subsets that each correspond to a different oneof a plurality of lanes of bits, and further comprising using eachsubset of the sub-lane sized bit selection elements to select bits fromwithin only a corresponding lane of bits.
 19. The method of claim 16,wherein storing comprises storing the result operand in a packed dataregister having a plurality of lanes of bits, and wherein a lane of bitsof the result operand includes the bits selected by the correspondingsubset of the sub-lane sized bit selection elements as well as aplurality of replicas of the bits selected by the corresponding subset.20. A system to process instructions comprising: an interconnect; aprocessor coupled with the interconnect, the processor to receive aninstruction that is to indicate a first source operand that is to haveat least one lane of bits, to indicate a second source packed dataoperand that is to have a number of sub-lane sized bit selectionelements, and to indicate a destination storage location, the processor,in response to the instruction, to store a result operand in thedestination storage location, the result operand to include a differentcorresponding bit for each of the number of sub-lane sized bit selectionelements, a value of each bit of the result operand corresponding to asub-lane sized bit selection element to be that of a bit of acorresponding lane of bits, of the at least one lane of bits of thefirst source operand, which is indicated by the corresponding sub-lanesized bit selection element; and a dynamic random access memory (DRAM)coupled with the interconnect.